panic with boot and -jX
% cat A.hs
module A where
% cat A.hs-boot
module A ( A ) where
type A = Maybe ()
yay :: A -> IO ()
% cat B.hs
module B where
import {-# SOURCE #-} A
This panics:
% rm -rf o ; ghc -j2 -outputdir o B
[1 of 3] Compiling A[boot] ( A.hs-boot, o/A.o-boot )
[2 of 3] Compiling A ( A.hs, o/A.o )
<no location info>: error:
ghc: panic! (the 'impossible' happened)
(GHC version 8.2.0.20170503 for x86_64-unknown-linux):
tcIfaceGlobal (local): not found
You are in a maze of twisty little passages, all alike.
While forcing the thunk for TyThing A
which was lazily initialized by initIfaceCheck typecheckLoop,
I tried to tie the knot, but I couldn't find A
in the current type environment.
If you are developing GHC, please read Note [Tying the knot]
and Note [Type-checking inside the knot].
Consider rebuilding GHC with profiling for a better stack trace.
Contents of current type environment:
[r15J :-> Identifier ‘$trModule’]
Call stack:
CallStack (from HasCallStack):
prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1134:58 in ghc:Outputable
callStackDoc, called at compiler/utils/Outputable.hs:1138:37 in ghc:Outputable
pprPanic, called at compiler/iface/TcIface.hs:1689:23 in ghc:TcIface
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
This works:
% rm -rf o ; ghc -j1 -outputdir o B
[1 of 3] Compiling A[boot] ( A.hs-boot, o/A.o-boot )
[2 of 3] Compiling A ( A.hs, o/A.o )
A.hs-boot:3:1: error:
‘A.A’ is exported by the hs-boot file, but not exported by the module
|
3 | type A = Maybe ()
| ^^^^^^^^^^^^^^^^^
Trac metadata
Trac field | Value |
---|---|
Version | 8.2.1-rc2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |