Skip to content

Backpack nameModule panic

The following variation on the bkpreex01 test causes a panic:

unit t23080-unit1 where
  signature H1 where
    data T
unit t23080-unit2 where
  dependency t23080-unit1[H1=<H2>]
  module B where
    data T = MkT
  signature H2(T(MkT)) where
    import B
λ ghc --backpack T23080.bkp
[1 of 2] Processing t23080-unit1
  [1 of 1] Compiling H1[sig]          ( t23080-unit1\H1.hsig, nothing )
[2 of 2] Processing t23080-unit2
  [1 of 3] Compiling B                ( t23080-unit2\B.hs, nothing )
  [2 of 3] Compiling H2[sig]          ( t23080-unit2\H2.hsig, nothing )

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.4.4:
        nameModule
  internal MkT_02y
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler\GHC\Utils\Panic.hs:182:37 in ghc:GHC.Utils.Panic
        pprPanic, called at compiler\GHC\Types\Name.hs:325:3 in ghc:GHC.Types.Name

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

The issue has to do with the export of the data constructor MkT from H2... changing the export to T(..) makes the panic go away.

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