Skip to content

Mysterious RULES-related(?) panic with 9.2.1

While working on this bytestring pull request, one of my changes caused GHC 9.2.1 to mysteriously panic instead of successfully compiling the Data.ByteString.Internal module, as witnessed by my local testing and this CI run.

Steps to reproduce

Compiling this file Internal.hs with GHC 9.2.1 produces the following error message:

Click to expand
ghc: panic! (the 'impossible' happened)
  (GHC version 9.2.1:
        refineFromInScope
  InScope {wild_00 $dIP_a16J $cp1Monoid_a16N $cmempty_a16P
           $cmappend_a16X $cmconcat_a174 $c<>_a17c $csconcat_a17j $krep_a18N
           concat stimesPolymorphic stimesInt $tc'BS $tcByteString
           $fMonoidByteString $fSemigroupByteString $trModule $dIP_s19g}
  $dMonoid_a15E
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:181:37 in ghc:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/Core/Opt/Simplify/Env.hs:706:30 in ghc:GHC.Core.Opt.Simplify.Env

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

Environment

  • GHC version used: 9.2.1
  • Operating System: WSL v2 on Windows 10
  • System Architecture: x86-64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information