9.6 assertion failure - constraint vs type
module Data.NonEmpty.Class where
import qualified Control.DeepSeq as DeepSeq
class NFData f where
rnf :: DeepSeq.NFData a => f a -> ()
instance NFData Maybe where
rnf = DeepSeq.rnf
> ~/head.hackage/ghc/bin/ghc Class.hs -O
<no location info>: error:
panic! (the 'impossible' happened)
GHC version 9.6.0.20230220:
ASSERT failed!
Coercion = Kind (Sym (N:NFData[0] <a_aMw>_N))
LHS ty = *
RHS ty = Constraint
cs = Tc(0)
coercion role = nominal
Call stack:
CallStack (from HasCallStack):
assertPpr, called at compiler/GHC/Core/Coercion.hs:1126:5 in ghc:GHC.Core.Coercion
mkSelCo_maybe, called at compiler/GHC/Core/Coercion.hs:1118:16 in ghc:GHC.Core.Coercion
mkSelCo, called at compiler/GHC/Core/Coercion.hs:620:5 in ghc:GHC.Core.Coercion
mkRuntimeRepCo, called at compiler/GHC/Core/Unify.hs:1584:16 in ghc:GHC.Core.Unify
CallStack (from HasCallStack):
panic, called at compiler/GHC/Utils/Error.hs:454:29 in ghc:GHC.Utils.Error
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
Edited by sheaf