id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
3958	method definitions fail to refer to method-context classes	visionete		"Sorry in advance if this is my lack of understanding...[[BR]]
The following code fails:[[BR]]

{{{
class Cfoo a where
    f :: Int -> a -> Int

data Foo = F Int

instance Cfoo Foo where
    f m (F n) = m + n

data Bar = B Int

class Cbar a where
    g :: (Cfoo b) => a -> b

instance Cbar Bar where
    g (B m) = F m
}}}


with error:[[BR]]
{{{
Couldn't match expected type `b' against inferred type `Foo'
      `b' is a rigid type variable bound by
          the type signature for `g' at [...]
    In the expression: F m
    In the definition of `g': g (B m) = F m
    In the instance declaration for `Cbar Bar'
}}}
It's as if the ""instance Cfoo Foo"" statement is ignored when processing ""instance CBar Bar"""	bug	closed	normal		Compiler (Type checker)	6.12.1	invalid			Linux	x86_64 (amd64)	GHC rejects valid program					
