"*** Exception: expectJust showModule" in ghci with hs-boot
ghci runs into an exception if there is an error in Foo.hs when there exists a Foo.hs-boot (which compiles fine).
- First.hs-boot
module First where
one :: Int
- Second.hs
module Second where
import {-# SOURCE #-} First
two :: Int
two = one + 1
- First.hs
module First where
import Second
one :: Int
one = _
> ghci
Prelude> :l First
[1 of 3] Compiling First[boot] ( First.hs-boot, interpreted )
[2 of 3] Compiling Second ( Second.hs, interpreted )
[3 of 3] Compiling First ( First.hs, interpreted )
First.hs:6:7: error:
• Found hole: _ :: Int
• In the expression: _
In an equation for ‘one’: one = _
• Relevant bindings include one :: Int (bound at First.hs:6:1)
*** Exception: expectJust showModule
CallStack (from HasCallStack):
error, called at compiler/utils/Maybes.hs:48:27 in ghc:Maybes
This happens on ghc-8.0.1, 8.0.2 and 8.2.1-rc1. The above output is from 8.0.2, but the error seems to be essentially the same on 8.2.1-rc1. It did not happen on 7.10.3.
While ghci continues to work, the exception appears to clear the loaded-modules list, which in turn breaks tooling (ghcid here, which hangs as a consequence). The expected behaviour would be that other modules (which contain no errors) remain loaded.
Trac metadata
Trac field | Value |
---|---|
Version | 8.2.1-rc1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |