type checker could not deduce ambiguous instances
GHC halts with a type error on the following program. If I comment out a seemingly unrelated part, it compiles though.
Tested with GHC 7.8.2
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
class
(F a ~ Int) => -- if this line is commented out, the program compiles
C a where
type F a
f :: b -> a
run :: (forall a. C a => a) -> ()
run _ = ()
x = run (f 0) -- type error: Could not deduce (Num b0) arising from the literal ‘0’ from the context (C a)
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |