id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
5514	bad variable escape analysis when TypeFamilies are enabled	dmwit		"The following minimal example causes a type error in 7.3.20110927:

{{{
{-# LANGUAGE TypeFamilies #-}

class Foo a where
	foo :: a -> a

instance (Foo a, Foo b) => Foo (a, b) where
	foo = foo' ()

foo' es = const id (unitId es)

unitId :: () -> ()
unitId = id
}}}

Specifically, the error given is:

{{{
test.hs:6:10:
    Couldn't match type `a0' with `(a, b)'
      because type variables `a', `b' would escape their scope
    These (rigid, skolem) type variables are bound by
      the instance declaration
    The following variables have types that mention a0
      foo' :: () -> a0 -> a0 (bound at test.hs:9:1)
    In the instance declaration for `Foo (a, b)'
}}}

This code compiles successfully as recently as 7.3.20110726 (though I haven't tested any GHC versions in between these two)."	bug	closed	normal		Compiler	7.3	fixed			Unknown/Multiple	Unknown/Multiple	None/Unknown		typecheck/should_compile/T5514			
