summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail149.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/tcfail149.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail149.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/tcfail149.hs b/testsuite/tests/typecheck/should_fail/tcfail149.hs
new file mode 100644
index 0000000000..2479ed75c8
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/tcfail149.hs
@@ -0,0 +1,14 @@
+module Main where
+
+class C a where
+ op :: (Show a, Show b) => a -> b -> String
+ -- This class op adds a constraint on 'a'
+
+ -- In GHC 7.0 this is fine, and it's a royal
+ -- pain to reject it when in H98 mode, so
+ -- I'm just allowing it
+
+instance C Int where
+ op x y = show x ++ " " ++ show y
+
+main = print (op (1::Int) 2)