ghci -fdefer-type-errors can't run IO action from another module
This is enough to trigger a crash on OS X and Linux:
module Bug1.hs where import qualified Bug2 test :: IO Bool test = Bug2.failure
module Bug2 where failure :: IO Bool failure = return False
% ghci -fdefer-type-errors -ignore-dot-ghci GHCi, version 8.4.1: http://www.haskell.org/ghc/ :? for help Prelude> :load Bug [1 of 2] Compiling Bug2 ( Bug2.hs, interpreted ) [2 of 2] Compiling Bug ( Bug.hs, interpreted ) Ok, two modules loaded. *Bug> test ghc: panic! (the 'impossible' happened) (GHC version 8.4.1 for x86_64-apple-darwin): nameModule system $dShow_a1LX Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable pprPanic, called at compiler/basicTypes/Name.hs:241:3 in ghc:Name Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
This is specific to 8.4.1, in 8.0.2 I get "False" as expected. If I leave off -fdefer-type-errors, it works. It also seems to be ghci only, compiling with -fdefer-type-errors doesn't have the problem.