Interface typechecking panics on type data
See also:
Two input modules:
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DataKinds, TypeData #-}
module TypeData.Lib where
data TermLevel = Mk
type data TypeLevel = Mk
class C (a :: TypeLevel)
instance C Mk where
foo :: C a => proxy a -> ()
foo _ = ()
{-# LANGUAGE NoImplicitPrelude #-}
module TypeData.Main where
import TypeData.Lib
bar = foo
This causes GHC to panic in tyThingDataCon
, as called from tcIfaceTyCon
:
]$ ./_build/stage1/bin/ghc -debug -fforce-recomp -iinput -fno-code ./input/TypeData/Main.hs
[1 of 2] Compiling TypeData.Lib ( input/TypeData/Lib.hs, nothing )
[2 of 2] Compiling TypeData.Main ( input/TypeData/Main.hs, nothing )
<no location info>: error:
panic! (the 'impossible' happened)
GHC version 9.5.20221012:
tyThingDataCon
Type constructor ‘Mk’
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/GHC/Utils/Panic.hs:188:37 in ghc:GHC.Utils.Panic
pprPanic, called at compiler/GHC/Types/TyThing.hs:293:46 in ghc:GHC.Types.TyThing
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug