summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-10-22 16:04:39 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-10-27 13:27:57 +0000
commitf86fb5e5a0694ea57cace824bbc0dce06bdf0698 (patch)
tree277dafd8b568b05c28ebcf4b0b64f6e9d5ecca83
parentc10c01cdd59c5068efcb480c4cc8fb50f354e0b1 (diff)
downloadhaskell-f86fb5e5a0694ea57cace824bbc0dce06bdf0698.tar.gz
Add regression tests for #10045, #10999
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T10045.hs8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T10045.stderr24
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T10999.hs8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/T10999.stderr1
-rw-r--r--testsuite/tests/partial-sigs/should_fail/all.T2
5 files changed, 43 insertions, 0 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/T10045.hs b/testsuite/tests/partial-sigs/should_fail/T10045.hs
new file mode 100644
index 0000000000..9b8c45f49b
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_fail/T10045.hs
@@ -0,0 +1,8 @@
+module T10045 where
+
+newtype Meta = Meta ()
+
+foo (Meta ws1) =
+ let copy :: _
+ copy w from = copy w True
+ in copy ws1 False
diff --git a/testsuite/tests/partial-sigs/should_fail/T10045.stderr b/testsuite/tests/partial-sigs/should_fail/T10045.stderr
new file mode 100644
index 0000000000..c57170ebc2
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_fail/T10045.stderr
@@ -0,0 +1,24 @@
+
+T10045.hs:6:18: error:
+ Found type wildcard ‘_’ standing for ‘t1 -> Bool -> t2’
+ Where: ‘t1’ is a rigid type variable bound by
+ the inferred type of copy :: t1 -> Bool -> t2 at T10045.hs:7:10
+ ‘t2’ is a rigid type variable bound by
+ the inferred type of copy :: t1 -> Bool -> t2 at T10045.hs:7:10
+ To use the inferred type, enable PartialTypeSignatures
+ Relevant bindings include
+ ws1 :: () (bound at T10045.hs:5:11)
+ foo :: Meta -> t (bound at T10045.hs:5:1)
+ In the type signature for:
+ copy :: _
+ In the expression:
+ let
+ copy :: _
+ copy w from = copy w True
+ in copy ws1 False
+ In an equation for ‘foo’:
+ foo (Meta ws1)
+ = let
+ copy :: _
+ copy w from = copy w True
+ in copy ws1 False
diff --git a/testsuite/tests/partial-sigs/should_fail/T10999.hs b/testsuite/tests/partial-sigs/should_fail/T10999.hs
new file mode 100644
index 0000000000..07d86ffe96
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_fail/T10999.hs
@@ -0,0 +1,8 @@
+module T10999 where
+
+import qualified Data.Set as Set
+
+f :: () -> _
+f _ = Set.fromList undefined
+
+g = map fst $ Set.toList $ f ()
diff --git a/testsuite/tests/partial-sigs/should_fail/T10999.stderr b/testsuite/tests/partial-sigs/should_fail/T10999.stderr
new file mode 100644
index 0000000000..0519ecba6e
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_fail/T10999.stderr
@@ -0,0 +1 @@
+ \ No newline at end of file
diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T
index d172a01c7c..bebd8bda86 100644
--- a/testsuite/tests/partial-sigs/should_fail/all.T
+++ b/testsuite/tests/partial-sigs/should_fail/all.T
@@ -59,4 +59,6 @@ test('WildcardInTypeFamilyInstanceRHS', normal, compile_fail, [''])
test('WildcardInTypeSynonymLHS', normal, compile_fail, [''])
test('WildcardInTypeSynonymRHS', normal, compile_fail, [''])
test('T10615', normal, compile_fail, [''])
+test('T10045', normal, compile_fail, [''])
+test('T10999', normal, compile_fail, [''])