summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail040.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/tcfail040.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail040.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/tcfail040.hs b/testsuite/tests/typecheck/should_fail/tcfail040.hs
new file mode 100644
index 0000000000..8ac06b363c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/tcfail040.hs
@@ -0,0 +1,29 @@
+-- !!! instances of functions
+--
+module ShouldFail where
+
+data NUM = ONE | TWO
+
+class EQ a where
+ (===) :: a -> a -> Bool
+
+class ORD a where
+ (<<) :: a -> a -> Bool
+ a << b = True
+
+instance EQ (a -> b) where
+ f === g = True
+
+instance ORD (a -> b)
+
+f = (<<) === (<<)
+--f :: (EQ a,Num a) => a -> a -> Bool
+
+
+{-
+instance EQ NUM where
+-- a /= b = False
+ a === b = True
+-- a /= b = False
+
+-}