Wrong inferred type shown
When the warning for missing type signatures is turned on the displayed type is sometimes totally bogus.
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, UndecidableInstances #-}
module Bug where
class C a b | a -> b, b -> a where
f :: a -> b
instance C Int Bool where
f = undefined
instance (C a c, C b d) => C (a -> b) (c -> d) where
f = undefined
foo :: Int -> Int
foo = undefined
bar = f foo
GHC says:
Warning: Definition but no type signature for `bar'
Inferred type: bar :: c -> d
The type for bar is, of course, Bool->Bool, and nothing else.
-- Lennart
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.10.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | lennart@augustsson.net |
| Operating system | |
| Architecture |