ghci -fdefer-type-errors can't run IO action from another module
This is enough to trigger a crash on OS X and Linux:
Bug1.hs:
module Bug1.hs where
import qualified Bug2
test :: IO Bool
test = Bug2.failure
Bug2.hs:
module Bug2 where
failure :: IO Bool
failure = return False
Shell:
% 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.
Trac metadata
Trac field | Value |
---|---|
Version | 8.4.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |