id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
1123	Impredicativity bug: forall not hoisted properly	Ashley Yakeley <ashley@…>	simonpj	"Try compiling this:
{{{
{-# OPTIONS -fglasgow-exts #-}
module Bug where
	data T a = MkT

	out :: forall a. T a -> ()
	out MkT = ()

	inHoisted :: forall r. () -> (forall a. T a -> r) -> r
	inHoisted _ foo = foo MkT

	inUnhoisted :: () -> forall r. (forall a. T a -> r) -> r
	inUnhoisted _ foo = foo MkT
	
	testHoisted :: ()
	testHoisted = inHoisted () out
	
	testUnhoisted :: ()
	testUnhoisted = inUnhoisted () out
}}}
Results:
{{{
Bug.hs:18:17:
    Couldn't match expected type `T a -> ()'
           against inferred type `forall a1. T a1 -> r'
      Expected type: (T a -> ()) -> ()
      Inferred type: (forall a1. T a1 -> r) -> r
    In the expression: inUnhoisted () out
    In the definition of `testUnhoisted':
        testUnhoisted = inUnhoisted () out
}}}
Expected:
testUnhoisted to compile, just like testHoisted"	bug	closed	low	7.0.1	Compiler	6.6	fixed		emertens@…	Unknown/Multiple	Unknown/Multiple	None/Unknown	Unknown	typecheck/should_compile/T1123			
