Ticket #7164 (closed bug: fixed)
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 22.214.171.12420810 (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.