Confusing "not a (visible) method" warning when method name clashes with another definition
Given this code:
class Foo m where
herp :: (a -> a) -> m b -> m b
derp :: m a
derp :: Int
derp = 123
GHC 7.4.1, 7.4.2, and 7.6.0.20120810 (rc1) produce the following output:
not-visible-method.hs:3:5:
`derp' is not a (visible) method of class `Foo'
not-visible-method.hs:6:1:
Multiple declarations of `derp'
Declared at: not-visible-method.hs:3:5
not-visible-method.hs:6:1
The second error makes sense, but the first one is bogus. I'm defining class Foo
! If I remove the clashing derp
, the module compiles.
GHC 7.0.3 and 7.2.2 produce the correct output.
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.1-rc1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |