Mysterious error from ghc6.2

George Russell ger at informatik.uni-bremen.de
Thu Mar 11 05:31:37 EST 2004


# ghc -c FunnyError.hs

FunnyError.hs:7:
     Couldn't match `Bool' against `[Char]'
	Expected type: Bool
	Inferred type: [Char]
     In the definition of `b': b x "Foo" = ()
     In the definition for method `b'

FunnyError.hs:9:
     tcLookup: `FunnyError.$dmb' is not in scope
     In the definition of `b': b = FunnyError.$dmb
     In the definition for method `b'
     In the instance declaration for `A Int'


The first error is correct, but the second error message is most peculiar,
is it not?
-------------- next part --------------
{- ghc6.2 -}
module FunnyError where

class A x where
   a :: x -> ()
   b :: x -> Bool -> ()
   b x "Foo" = () -- deliberate type error

instance A Int where
   a _ = ()


More information about the Glasgow-haskell-bugs mailing list