$ inplace/bin/ghc-stage2 --interactiveGHCi, version 8.5.20180403: http://www.haskell.org/ghc/ :? for helpPrelude> 11Prelude> 11Prelude> _<interactive>:1:1: error:GHC internal error: ‘Ghci1.it’ is not in scope during type > checking, but it passed the renamertcl_env of environment: []
(giving "1" twice is needed to reproduce the error)
NB: input "1" twice to create shadowed context is necessary to reproduce this bug.
$ ~/Software/ghc/inplace/bin/ghc-stage2 --interactiveGHCi, version 8.5.20180420: http://www.haskell.org/ghc/ :? for helpLoaded GHCi configuration from /home/rgscott/.ghciλ> data Fλ> data Fλ> _<interactive>:1:1: error: GHC internal error: ‘Ghci1.$trModule’ is not in scope during type checking, but it passed the renamer tcl_env of environment: []
<interactive>:1:1: error:GHC internal error: ‘Ghci1.$trModule’ is not in scope during type checking, but it passed the renamertcl_env of environment: [r2CZ :-> Identifier[foo::String, TopLevelLet]]
Reverting this back to "new". It seems to me that the patch doesn't actually fix this problem, but works around it. Please make the status "patch" again if I'm wrong.
This ticket isn't fixed by D4909. With a debug-enabled stage2 compiler, for the script in description, we will get a panic:
Prelude> 11(0.02 secs, 65,728 bytes)Prelude> 11(0.00 secs, 64,352 bytes)Prelude> _ghc-stage2.exe: panic! (the 'impossible' happened) (GHC version 8.7.20180629 for x86_64-unknown-mingw32): ASSERT failed! Cur lvl = 1 Imp lvl = 1 Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler\utils\Outputable.hs:1164:37 in ghc:Outputable pprPanic, called at compiler\utils\Outputable.hs:1223:5 in ghc:Outputable assertPprPanic, called at compiler\\typecheck\\TcSimplify.hs:1548:120 in ghc:TcSimplifyCallStack (from -prof): HscMain.ioMsgMaybe (compiler\main\HscMain.hs:(252,1)-(257,128)) HscMain.hscParsedStmt (compiler\main\HscMain.hs:(1548,1)-(1564,36)) HscMain.hscStmtWithLocation (compiler\main\HscMain.hs:(1533,1)-(1541,50)) GHC.withCleanupSession (compiler\main\GHC.hs:(469,1)-(477,27)) GHC.runGhc (compiler\main\GHC.hs:(444,1)-(449,26)) GHC.defaultErrorHandler (compiler\main\GHC.hs:(384,1)-(416,7))
Besides, this ticket is intend to solve the problem described in #11547 (closed), the GHC internal error (for script reported by #11547 (closed)) still occurs after D4909.
sighingnow, are you sure you rebuilt it correctly? I'm also using a debug-enabled compiler and here are the outputs I'm getting:
~ $ ghc-stage2 --interactiveGHCi, version 8.7.20180704: http://www.haskell.org/ghc/ :? for helpPrelude> 11Prelude> 11Prelude> _<interactive>:3:1: error: • Found hole: _ :: t Where: ‘t’ is a rigid type variable bound by the inferred type of it :: t at <interactive>:3:1 • In the expression: _ In an equation for ‘it’: it = _ • Relevant bindings include it :: t (bound at <interactive>:3:1)Prelude>
~ $ ghc-stage2 --interactiveGHCi, version 8.7.20180704: http://www.haskell.org/ghc/ :? for helpPrelude> let x = ()Prelude> let x = ()Prelude> :t _<interactive>:1:1: error: • Found hole: _ :: t Where: ‘t’ is a rigid type variable bound by the inferred type of it :: t at <interactive>:1:1 • In the expression: _Prelude>
I have rebuilt the stage2 compiler after manually delete all .o and .hi files in compiler/stage2/build and still get the same panic. I will try a fresh build later.