
5 Jul
2008
5 Jul
'08
7:10 p.m.
On Sun, Jul 06, 2008 at 12:00:07AM +0100, Neil Mitchell wrote:
This is either a GHC bug, or a Yhc+Hugs bug - I'm not sure which, but the compilers disagree:
import Prelude hiding ((==)) data Foo = Foo instance Eq Foo where (==) a b = True
GHC says: Temp.hs:14:4: `==' is not a (visible) method of class `Eq'
Yhc and Hugs both successfully compile the module.
Does anyone know which compiler(s) are in the wrong, and need bugs filing?
GHC is correct. Report 4.3.2: "It is illegal to give a binding for a class method that is not in scope, but the name under which it is in scope is immaterial; in particular, it may be a qualified name." In this case neither == nor Prelude.== is in scope.