[commit: ghc] master: Fix up test for T7861 (678df4c)
git at git.haskell.org
git at git.haskell.org
Fri Jan 9 12:59:10 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/678df4c2930c4aef61b083edb0f5c4d8c8914a76/ghc
>---------------------------------------------------------------
commit 678df4c2930c4aef61b083edb0f5c4d8c8914a76
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Jan 9 13:00:16 2015 +0000
Fix up test for T7861
Fixes Trac #9972
>---------------------------------------------------------------
678df4c2930c4aef61b083edb0f5c4d8c8914a76
testsuite/tests/typecheck/should_run/T7861.hs | 10 +++++++++-
testsuite/tests/typecheck/should_run/T7861.stderr | 2 +-
testsuite/tests/typecheck/should_run/T7861.stdout | 3 ++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/testsuite/tests/typecheck/should_run/T7861.hs b/testsuite/tests/typecheck/should_run/T7861.hs
index 1f2066c..9ff9a43 100644
--- a/testsuite/tests/typecheck/should_run/T7861.hs
+++ b/testsuite/tests/typecheck/should_run/T7861.hs
@@ -10,4 +10,12 @@ doA = undefined
f :: A a -> a
f = doA
-main = do { print "Hello"; f `seq` print "Bad" }
+main = do { print "Hello 1"
+
+ ; f `seq` print "Hello 2"
+ -- The casts are pushed inside the lambda
+ -- for f, so this seq succeds fine
+
+ ; f (error "urk") `seq` print "Bad"
+ -- But when we *call* f we get a type error
+ }
diff --git a/testsuite/tests/typecheck/should_run/T7861.stderr b/testsuite/tests/typecheck/should_run/T7861.stderr
index b3e3140..f9f2386 100644
--- a/testsuite/tests/typecheck/should_run/T7861.stderr
+++ b/testsuite/tests/typecheck/should_run/T7861.stderr
@@ -1,7 +1,7 @@
T7861: T7861.hs:11:5:
Couldn't match type ‘a’ with ‘[a]’
‘a’ is a rigid type variable bound by
- the type signature for f :: A a -> a at T7861.hs:10:6
+ the type signature for: f :: A a -> a at T7861.hs:10:6
Expected type: A a -> a
Actual type: A a -> [a]
Relevant bindings include f :: A a -> a (bound at T7861.hs:11:1)
diff --git a/testsuite/tests/typecheck/should_run/T7861.stdout b/testsuite/tests/typecheck/should_run/T7861.stdout
index 4b849db..6578f43 100644
--- a/testsuite/tests/typecheck/should_run/T7861.stdout
+++ b/testsuite/tests/typecheck/should_run/T7861.stdout
@@ -1 +1,2 @@
-"Hello"
+"Hello 1"
+"Hello 2"
More information about the ghc-commits
mailing list