Skip to content

InstantiatedNamedWildcardsInConstraints test fails in an unexpected way

InstantiatedNamedWildcardsInConstraints is supposed to fail with a type error, but on my system it fails with a panic:

$ ghc-stage2 InstantiatedNamedWildcardsInConstraints.hs
[1 of 1] Compiling InstantiatedNamedWildcardsInConstraints ( InstantiatedNamedWildcardsInConstraints.hs, InstantiatedNamedWildcardsInConstraints.o )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 8.9.20190403 for x86_64-unknown-linux):
        ASSERT failed!
  in_scope InScope {b_a1MF}
  tenv [aPX :-> b_a1MF[tyv:1]]
  cenv []
  tys [Enum __aPV[tau:1]]
  cos []
  needInScope {__aPV[tau:1]}
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1169:37 in ghc:Outputable
        pprPanic, called at compiler/utils/Outputable.hs:1230:5 in ghc:Outputable
        assertPprPanic, called at compiler/types/TyCoRep.hs:3207:51 in ghc:TyCoRep
        checkValidSubst, called at compiler/types/TyCoRep.hs:3249:17 in ghc:TyCoRep
        substTys, called at compiler/typecheck/TcSigs.hs:518:49 in ghc:TcSigs

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

I don't know why this does not happen on the CI jobs, but I suspect this is related to how GHC is built. If I try with GHC built with a custom build.mk for debugging this test fails as expected. I also tried with GHC 8.6.4 and it again failed as expected (no panics).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information