GHC panic on pattern synonym
{-# Language RankNTypes, ViewPatterns, PatternSynonyms, TypeOperators, KindSignatures, PolyKinds, DataKinds, TypeFamilies, TypeInType, GADTs #-}
import Data.Kind
data family Sing a
type a --> b = (a, b) -> Type
type family (@@) (f::a --> b) (x::a) :: b
data Proxy a = Proxy
newtype Limit' :: (k --> Type) -> Type where
Limit' :: (forall xx. Proxy xx -> f@@xx) -> Limit' f
data Exp :: [Type] -> Type -> Type where
TLam' :: Proxy f
-> (forall aa. Proxy aa -> Exp xs (f @@ aa))
-> Exp xs (Limit' f)
pattern FOO f <- TLam' Proxy (($ Proxy) -> f)
--->
$ ghci -ignore-dot-ghci 119-bug.hs
GHCi, version 8.3.20171122: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( 119-bug.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
(GHC version 8.3.20171122 for x86_64-unknown-linux):
ASSERT failed!
in_scope InScope {a_a1Mh b_a1Mi rep_a1MB r_a1MC}
tenv [a1MC :-> r_a1MC]
cenv []
tys [k_a1Mj[ssk:3]]
cos []
needInScope [a1Mj :-> k_a1Mj[ssk:3]]
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1205:22 in ghc:Outputable
assertPprPanic, called at compiler/types/TyCoRep.hs:2136:51 in ghc:TyCoRep
checkValidSubst, called at compiler/types/TyCoRep.hs:2159:29 in ghc:TyCoRep
substTy, called at compiler/types/TyCoRep.hs:2364:41 in ghc:TyCoRep
substTyVarBndr, called at compiler/coreSyn/CoreSubst.hs:571:10 in ghc:CoreSubst
Call stack:
CallStack (from HasCallStack):
callStackDoc, called at compiler/utils/Outputable.hs:1147:37 in ghc:Outputable
pprPanic, called at compiler/utils/Outputable.hs:1203:5 in ghc:Outputable
assertPprPanic, called at compiler/types/TyCoRep.hs:2136:51 in ghc:TyCoRep
checkValidSubst, called at compiler/types/TyCoRep.hs:2159:29 in ghc:TyCoRep
substTy, called at compiler/types/TyCoRep.hs:2364:41 in ghc:TyCoRep
substTyVarBndr, called at compiler/coreSyn/CoreSubst.hs:571:10 in ghc:CoreSubst
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
>
Trac metadata
Trac field | Value |
---|---|
Version | 8.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |