-fprefer-byte-code panics when combined with -fno-omit-interface-pragmas
The following two modules can be used to trigger a panic on GHC HEAD:
module A where
xs :: [a]
xs = []
{-# LANGUAGE TemplateHaskell #-}
module B where
import A
$(pure xs)
$ rm -f *.{o,hi} # ensure directory is clean
$ ghc -fno-omit-interface-pragmas -fwrite-if-simplified-core -fbyte-code-and-object-code -fprefer-byte-code A
[1 of 1] Compiling A ( A.hs, A.o, interpreted )
$ ghc -fwrite-if-simplified-core -fbyte-code-and-object-code -fprefer-byte-code B
[2 of 2] Compiling B ( B.hs, B.o, interpreted )
<no location info>: error: No match in record selector uf_tmpl
The error message is uninformative, but a little investigation reveals that the failing call to uf_tmpl
is in GHC.IfaceToCore.tc_iface_binding
.