Panic on type error inside a type-level newtype
{-# LANGUAGE DataKinds, TypeFamilies #-}
newtype X = RollX (() -> X)
type family F t :: X where
F t = RollX (t -> ())
gives
ghc: panic! (the 'impossible' happened)
(GHC version 8.2.1 for x86_64-apple-darwin):
repSplitAppTys
t_a1po[sk:1]
()
[]
Call stack:
CallStack (from HasCallStack):
prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable
callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:808:9 in ghc:Type