id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
5792	PolyKinds and recompilation causes internal error	reinerp	simonpj	"Given these two files:
{{{
module A where
-- empty
}}}

and

{{{

{-# LANGUAGE PolyKinds, TypeFamilies, UndecidableInstances #-}
module B where

import A

data T = TT

type family Compare (m :: T) :: Ordering
type instance Compare TT = Compare TT

type Compare' a = Compare a
}}}

We can cause an internal GHC error as follows:

{{{
$ rm *.o *.hi
$ ghc B.hs
[1 of 2] Compiling A                ( A.hs, A.o )
[2 of 2] Compiling B                ( B.hs, B.o )
$ sleep 1
$ touch B.hs
$ ghc B.hs
[2 of 2] Compiling B                ( B.hs, B.o )

B.hs:11:19:
    GHC internal error: `Compare' is not in scope during type checking, but it passed the renamer
    tcl_env of environment: [(a9R, AThing k_a9U)]
    In the type `Compare a'
    In the type synonym declaration for Compare'
}}}
"	bug	closed	high	7.4.2	Compiler (Type checker)	7.4.1-rc1	fixed	PolyKinds		Unknown/Multiple	Unknown/Multiple	Compile-time crash	Unknown	typecheck/should_compile/T5792			
