summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_run/T2985.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/indexed-types/should_run/T2985.hs')
-rw-r--r--testsuite/tests/indexed-types/should_run/T2985.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_run/T2985.hs b/testsuite/tests/indexed-types/should_run/T2985.hs
new file mode 100644
index 0000000000..6ae6e12c50
--- /dev/null
+++ b/testsuite/tests/indexed-types/should_run/T2985.hs
@@ -0,0 +1,13 @@
+{-# LANGUAGE TypeFamilies, UndecidableInstances #-}
+{-# OPTIONS_GHC -Wnot #-}
+
+module Main where
+
+-- See http://article.gmane.org/gmane.comp.lang.haskell.general/16796
+-- and Trac #2985
+
+instance (Num a, Num b, a ~ b) => Num (a,b) where
+ (x,y) * (u,v) = (x*u-y*v, x*v+y*u)
+
+test1 = (1,1) * (2,2)
+main = print test1