summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs/should_fail
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/partial-sigs/should_fail')
-rw-r--r--testsuite/tests/partial-sigs/should_fail/Trac10045.hs8
-rw-r--r--testsuite/tests/partial-sigs/should_fail/Trac10045.stderr45
-rw-r--r--testsuite/tests/partial-sigs/should_fail/all.T1
3 files changed, 54 insertions, 0 deletions
diff --git a/testsuite/tests/partial-sigs/should_fail/Trac10045.hs b/testsuite/tests/partial-sigs/should_fail/Trac10045.hs
new file mode 100644
index 0000000000..e7c07470aa
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_fail/Trac10045.hs
@@ -0,0 +1,8 @@
+module Trac10045 where
+
+newtype Meta = Meta ()
+
+foo (Meta ws1) =
+ let copy :: _
+ copy w from = copy w 1
+ in copy ws1 1
diff --git a/testsuite/tests/partial-sigs/should_fail/Trac10045.stderr b/testsuite/tests/partial-sigs/should_fail/Trac10045.stderr
new file mode 100644
index 0000000000..8c8e42f704
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_fail/Trac10045.stderr
@@ -0,0 +1,45 @@
+
+Trac10045.hs:6:17:
+ Found hole ‘_’ with type: t1 -> a -> t2
+ Where: ‘t1’ is a rigid type variable bound by
+ the inferred type of copy :: Num a => t1 -> a -> t2
+ at Trac10045.hs:7:9
+ ‘t2’ is a rigid type variable bound by
+ the inferred type of copy :: Num a => t1 -> a -> t2
+ at Trac10045.hs:7:9
+ ‘a’ is a rigid type variable bound by
+ the inferred type of copy :: Num a => t1 -> a -> t2
+ at Trac10045.hs:7:9
+ To use the inferred type, enable PartialTypeSignatures
+ Relevant bindings include
+ ws1 :: () (bound at Trac10045.hs:5:11)
+ foo :: Meta -> t (bound at Trac10045.hs:5:1)
+ In the type signature for ‘copy’: _
+ In the expression:
+ let
+ copy :: _
+ copy w from = copy w 1
+ in copy ws1 1
+ In an equation for ‘foo’:
+ foo (Meta ws1)
+ = let
+ copy :: _
+ copy w from = copy w 1
+ in copy ws1 1
+
+Trac10045.hs:7:9:
+ No instance for (Num a)
+ When checking that ‘copy’ has the specified type
+ copy :: forall t t1 a. t -> a -> t1
+ Probable cause: the inferred type is ambiguous
+ In the expression:
+ let
+ copy :: _
+ copy w from = copy w 1
+ in copy ws1 1
+ In an equation for ‘foo’:
+ foo (Meta ws1)
+ = let
+ copy :: _
+ copy w from = copy w 1
+ in copy ws1 1
diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T
index 7e56d15c71..c49a36fe34 100644
--- a/testsuite/tests/partial-sigs/should_fail/all.T
+++ b/testsuite/tests/partial-sigs/should_fail/all.T
@@ -18,6 +18,7 @@ test('ScopedNamedWildcardsBad', normal, compile_fail, [''])
test('TidyClash', normal, compile_fail, [''])
# Bug
test('TidyClash2', expect_fail, compile_fail, [''])
+test('Trac10045', normal, compile_fail, [''])
test('UnnamedConstraintWildcard1', normal, compile_fail, [''])
test('UnnamedConstraintWildcard2', normal, compile_fail, [''])
test('WildcardInADT1', normal, compile_fail, [''])