#4494: Another regression with type families
---------------------------------+------------------------------------------
Reporter: rl | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Type checker)
Version: 7.1 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: GHC rejects valid program
---------------------------------+------------------------------------------
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.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4494>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs