summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail121.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/tcfail121.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail121.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/tcfail121.hs b/testsuite/tests/typecheck/should_fail/tcfail121.hs
new file mode 100644
index 0000000000..86c2a92c5c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/tcfail121.hs
@@ -0,0 +1,14 @@
+
+{-# LANGUAGE OverlappingInstances, FlexibleInstances #-}
+
+module ShouldFail where
+
+class Foo a where
+ op :: a -> a
+
+instance Foo a => Foo [a]
+instance Foo [Int]
+
+foo :: Foo a => [a] -> [a]
+foo x = op x
+-- Correct instance depends on instantiation of 'a'