Test Trac #5759
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 10 Jan 2012 08:09:51 +0000 (08:09 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 10 Jan 2012 08:09:51 +0000 (08:09 +0000)
testsuite/tests/typecheck/should_run/T5759.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_run/T5759.stdout [new file with mode: 0644]
testsuite/tests/typecheck/should_run/all.T

diff --git a/testsuite/tests/typecheck/should_run/T5759.hs b/testsuite/tests/typecheck/should_run/T5759.hs
new file mode 100644 (file)
index 0000000..a15b3b6
--- /dev/null
@@ -0,0 +1,19 @@
+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, OverlappingInstances,
+    UndecidableInstances, FunctionalDependencies #-}
+
+module Main where
+
+class Container a b | a -> b where
+    make :: b -> a
+
+data Cont a = Cont a deriving (Show, Eq)
+
+instance Container (Cont a) a where
+    make x = Cont x
+
+instance (Container a b, Show a, Eq a, Num b) => Num a where
+    fromInteger x = make (fromInteger x)
+
+d = fromInteger 3 :: Cont Integer
+
+main = print d
\ No newline at end of file
diff --git a/testsuite/tests/typecheck/should_run/T5759.stdout b/testsuite/tests/typecheck/should_run/T5759.stdout
new file mode 100644 (file)
index 0000000..5a74c5f
--- /dev/null
@@ -0,0 +1 @@
+Cont 3
index aacdc7d..fa99ed9 100644 (file)
@@ -85,3 +85,4 @@ test('T3500b', normal, compile_and_run, [''])
 test('T4809', reqlib('mtl'), compile_and_run, [''])
 test('T2722', normal, compile_and_run, [''])
 test('mc17', normal, compile_and_run, [''])
+test('T5759', normal, compile_and_run, [''])