Improve error message in deriving( Functor )
[ghc.git] / testsuite / tests / typecheck / should_fail / tcfail149.hs
1 {-# LANGUAGE ConstrainedClassMethods #-}
2
3 module Main where
4
5 class C a where
6 op :: (Show a, Show b) => a -> b -> String
7 -- This class op adds a constraint on 'a'
8
9 -- In GHC 7.0 this is fine, and it's a royal
10 -- pain to reject it when in H98 mode, so
11 -- I'm just allowing it
12
13 instance C Int where
14 op x y = show x ++ " " ++ show y
15
16 main = print (op (1::Int) 2)