GHC panic (TypeInType)
{-# Language TypeInType, TypeFamilies, TypeOperators #-}
import Data.Kind
type a ~>> b = (a, b) -> Type
data family Sing (a::k)
type family
(·) (f::a~>>b) (x::a)::b
class PCategory kat where
type Id ::kat·a·a
type Comp::kat·b·c -> kat·a·b -> kat·a·c
class SCategory kat where
sId :: Sing a -> Sing (Id::kat a a)
sComp :: Sing f -> Sing g -> Sing (Comp f g)
triggers a panic
$ ghci -ignore-dot-ghci Bug.hs
GHCi, version 8.3.20171122: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( Bug.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.3.20171122 for x86_64-unknown-linux):
piResultTy
k_a1KI[tau:1]
a_a1vb[sk:1]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1147:37 in ghc:Outputable
pprPanic, called at compiler/types/Type.hs:951:35 in ghc:Type
piResultTy, called at compiler/types/Type.hs:2309:34 in ghc:Type
typeKind, called at compiler/types/Type.hs:2309:46 in ghc:Type
typeKind, called at compiler/typecheck/TcType.hs:1706:11 in ghc:TcType
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Trac metadata
Trac field | Value |
---|---|
Version | 8.2.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |