Test #10770
authorRichard Eisenberg <eir@cis.upenn.edu>
Sat, 19 Sep 2015 19:04:49 +0000 (15:04 -0400)
committerRichard Eisenberg <eir@cis.upenn.edu>
Mon, 21 Sep 2015 01:39:13 +0000 (21:39 -0400)
testsuite/tests/typecheck/should_compile/T10770a.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/T10770b.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T

diff --git a/testsuite/tests/typecheck/should_compile/T10770a.hs b/testsuite/tests/typecheck/should_compile/T10770a.hs
new file mode 100644 (file)
index 0000000..611c86e
--- /dev/null
@@ -0,0 +1,8 @@
+module T10770a where
+
+import Data.Typeable
+
+main = print $ foo $ Just ()
+
+foo :: Typeable (t a) => t a -> String
+foo x = let k = show $ typeOf x in k
diff --git a/testsuite/tests/typecheck/should_compile/T10770b.hs b/testsuite/tests/typecheck/should_compile/T10770b.hs
new file mode 100644 (file)
index 0000000..62ae61c
--- /dev/null
@@ -0,0 +1,9 @@
+{-# LANGUAGE FlexibleContexts #-}
+{-# OPTIONS_GHC -fwarn-redundant-constraints #-}
+module T10770b where
+
+f :: (Show a, Show (Maybe a)) => Maybe a -> String
+f x = let k = show x in k
+
+g :: (Show a, Show (Maybe a)) => Maybe a -> String
+g x = show x
index 6f34db4..da71c1d 100644 (file)
@@ -475,3 +475,5 @@ test('T10642', normal, compile, [''])
 test('T10744', normal, compile, [''])
 test('update-existential', normal, compile, [''])
 test('T10347', expect_broken(10347), compile, [''])
+test('T10770a', expect_broken(10770), compile, [''])
+test('T10770b', expect_broken(10770), compile, [''])