Test Trac #5001
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 30 Nov 2011 02:27:38 +0000 (02:27 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 30 Nov 2011 02:27:38 +0000 (02:27 +0000)
testsuite/tests/deSugar/should_compile/T5001.hs [new file with mode: 0644]
testsuite/tests/deSugar/should_compile/T5001a.hs [new file with mode: 0644]
testsuite/tests/deSugar/should_compile/all.T

diff --git a/testsuite/tests/deSugar/should_compile/T5001.hs b/testsuite/tests/deSugar/should_compile/T5001.hs
new file mode 100644 (file)
index 0000000..3b644cd
--- /dev/null
@@ -0,0 +1,10 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+module T5001 where
+
+import T5001a
+
+data T = T
+
+instance Comorphism Float Int Char T
+
diff --git a/testsuite/tests/deSugar/should_compile/T5001a.hs b/testsuite/tests/deSugar/should_compile/T5001a.hs
new file mode 100644 (file)
index 0000000..08c245c
--- /dev/null
@@ -0,0 +1,16 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+module T5001a (Comorphism(..)) where
+
+class Show a => Comorphism a b c d where
+    map_sentence :: a -> b -> c -> Result d
+    map_sentence = f
+
+f :: Comorphism a b c d => a -> b -> c -> Result d
+f x _ _ = fatal_error ("Unsupported sentence translation " ++ show x)
+
+data Result a = Result String
+
+fatal_error :: String -> Result a
+fatal_error s = Result s
+
index 40a4c24..35d5325 100644 (file)
@@ -89,3 +89,9 @@ test('T5252',
      run_command, 
      ['$MAKE -s --no-print-directory T5252'])
 test('T5455', normal, compile, [''])
+test('T5001',
+     [only_ways(['optasm']),
+      only_compiler_types(['ghc']),
+      extra_clean(['T5001a.hi', 'T5001a.o'])],
+     multimod_compile,
+     ['T5001', '-v0'])