id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
7006	Panic when promoted GADT arguments cross module boundaries	anders_		"This seems to only happen when the importing module is compiled in a separate invocation of GHC from the module containing the GADT. That is, it happens with `ghc -c`-ing the two separately, or with `--make`, when only the importing module has been changed since last time. Cleaning between each compile seems to be a workaround, but that’s a massive pain. `:)`

Sample code & GHC's reaction:

{{{
{-# LANGUAGE KindSignatures, TypeOperators, DataKinds, GADTs #-}
module A where

data List (xs :: [*]) where
  N    :: List '[]
  (:>) :: x -> List xs -> List (x ': xs)
}}}

{{{
{-# LANGUAGE GADTs, TypeOperators #-}
module B where
import A

foo :: List (x ': xs) -> x
foo (x :> _) = x
}}}

{{{
$ ghc -c A.hs
$ ghc -c B.hs
ghc: panic! (the 'impossible' happened)
  (GHC version 7.4.1 for x86_64-apple-darwin):
	tyThingTyCon Data constructor `ghc-prim:GHC.Types.:{(w) d 64}'

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
}}}

(As an aside, it’s kind of annoying that `TypeOperators` isn’t automatically implied by `DataKinds`, but that’s not important really.)"	bug	closed	normal		Compiler	7.4.1	fixed	DataKinds	andy@…	MacOS X	x86_64 (amd64)	Compile-time crash	Unknown				
