[commit: ghc] wip/rae: Test #10770 (733b203)
git at git.haskell.org
git at git.haskell.org
Sat Sep 19 20:25:27 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/rae
Link : http://ghc.haskell.org/trac/ghc/changeset/733b2037b4f23fbd602f5004971b2e6a6ec721bc/ghc
>---------------------------------------------------------------
commit 733b2037b4f23fbd602f5004971b2e6a6ec721bc
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date: Sat Sep 19 15:04:49 2015 -0400
Test #10770
>---------------------------------------------------------------
733b2037b4f23fbd602f5004971b2e6a6ec721bc
testsuite/tests/typecheck/should_compile/T10770a.hs | 8 ++++++++
testsuite/tests/typecheck/should_compile/T10770b.hs | 9 +++++++++
testsuite/tests/typecheck/should_compile/all.T | 2 ++
3 files changed, 19 insertions(+)
diff --git a/testsuite/tests/typecheck/should_compile/T10770a.hs b/testsuite/tests/typecheck/should_compile/T10770a.hs
new file mode 100644
index 0000000..611c86e
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T10770a.hs
@@ -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
index 0000000..62ae61c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T10770b.hs
@@ -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
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 6f34db4..da71c1d 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -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, [''])
More information about the ghc-commits
mailing list