id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
3297	Compiler panic on incorrect code (TcTyFuns.flattenType: synonym family in a rank-n type)	hesselink	chak	"On the following code sample the compiler panics with:

{{{
 ghc: panic! (the 'impossible' happened)
  (GHC version 6.11.20090403 for i386-unknown-linux):
	TcTyFuns.flattenType: synonym family in a rank-n type
}}}

I found this when working on some code when I made a mistake; the code should not type check, but should probably not crash the compiler either. I simplified the code to:

{{{
{-# LANGUAGE TypeFamilies
           , KindSignatures
           , RankNTypes
           #-}

type family PF a :: (* -> *) -> * -> *

class Ix a where
    type Es a :: * -> *
    from  :: a          -> PF a (Es a) a

crash :: (forall n. Es a n) -> a
crash = from
}}}

It seems similar to #3101, but that one was about data types. A similar example also seems to be in #1897, but this bug doesn't seem to fit that ticket's description."	bug	closed	low	7.2.1	Compiler (Type checker)	6.11	fixed			Linux	x86	None/Unknown	Unknown				
