summaryrefslogtreecommitdiff
path: root/ghc/compiler/tests/typecheck/should_fail/tcfail044.hs
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/compiler/tests/typecheck/should_fail/tcfail044.hs')
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail044.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail044.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail044.hs
new file mode 100644
index 0000000000..9d056409f1
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail044.hs
@@ -0,0 +1,22 @@
+--!!! tcfail044: duplicated type variable in instance decls
+--
+module Main where
+
+instance (Eq a) => Eq (a->a)
+
+
+instance (Num a) => Num (a->a) where
+ f + g = \x -> f x + g x
+ negate f = \x -> - (f x)
+ f * g = \x -> f x * g x
+ fromInteger n = \x -> fromInteger n
+
+ss :: Float -> Float
+cc :: Float -> Float
+tt :: Float -> Float
+
+ss = sin * sin
+cc = cos * cos
+tt = ss + cc
+
+main _ = [AppendChan stdout ((show (tt 0.4))++ " "++(show (tt 1.652)))]