id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
4494	Another regression with type families	rl		"Program (compile with !ScopedTypeVariables):

{{{
type family H s a b

class D (G v) => C v where
  type G v
  type F v
  foo :: v -> H (F v) (G v) v

class D s where
  bar :: (forall t. Maybe t -> a) -> s -> H a s r -> r

call :: forall v. C v => F v -> v
call x = bar (\_ -> x)
             (undefined :: G v)
             (foo (undefined :: v))

bar' :: C v => (forall t. Maybe t -> F v) -> G v -> H (F v) (G v) v -> v
bar' = bar
}}}

The current head (even with today's typechecker patch) complains:

{{{
    Could not deduce (H a (G v) v ~ H (F v) (G v) v)
      from the context (C v)
}}}

But if I change `bar` to `bar'` in the rhs of `foo`, it all works fine. 6.12.3 accepts both programs.
"	bug	closed	normal		Compiler (Type checker)	7.1	fixed			Unknown/Multiple	Unknown/Multiple	GHC rejects valid program		indexed-types/should_compile/T4494			
