summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-02-04 13:00:22 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-02-08 15:08:40 +0000
commita96c4e7ca391ff3003d5debf187e7d177131f2fe (patch)
treefb733d6a93f9fa83c3e87ad7d5af429c881f0ff3 /testsuite/tests
parent6036cb6f67892e445bb3150850365dc7c7d64a40 (diff)
downloadhaskell-a96c4e7ca391ff3003d5debf187e7d177131f2fe.tar.gz
Add comments to TcCoercibleFail
Flag up the problem highlighted in Trac #11518 comment:15
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/typecheck/should_fail/TcCoercibleFail.hs7
-rw-r--r--testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr6
2 files changed, 10 insertions, 3 deletions
diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.hs b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.hs
index c102da5cf8..833609d48a 100644
--- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.hs
+++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.hs
@@ -20,9 +20,16 @@ foo4 = coerce $ one :: Down Int
newtype Void = Void Void
foo5 = coerce :: Void -> ()
+
+------------------------------------
+-- This next one generates an exponentally big type as it
+-- tries to unwrap. See comment:15 in Trac #11518
+-- Adding asserions that force the types can make us
+-- run out of space.
newtype VoidBad a = VoidBad (VoidBad (a,a))
foo5' = coerce :: (VoidBad ()) -> ()
+------------------------------------
-- This shoul fail with a context stack overflow
newtype Fix f = Fix (f (Fix f))
foo6 = coerce :: Fix (Either Int) -> Fix (Either Age)
diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
index 32dac6a133..8c0df32063 100644
--- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
+++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
@@ -37,14 +37,14 @@ TcCoercibleFail.hs:21:8: error:
• In the expression: coerce :: Void -> ()
In an equation for ‘foo5’: foo5 = coerce :: Void -> ()
-TcCoercibleFail.hs:24:9: error:
+TcCoercibleFail.hs:30:9: error:
• Couldn't match representation of type ‘VoidBad ()’
with that of ‘()’
arising from a use of ‘coerce’
• In the expression: coerce :: (VoidBad ()) -> ()
In an equation for ‘foo5'’: foo5' = coerce :: (VoidBad ()) -> ()
-TcCoercibleFail.hs:28:8: error:
+TcCoercibleFail.hs:35:8: error:
• Reduction stack overflow; size = 201
When simplifying the following type:
Coercible (Fix (Either Int)) (Fix (Either Age))
@@ -56,7 +56,7 @@ TcCoercibleFail.hs:28:8: error:
In an equation for ‘foo6’:
foo6 = coerce :: Fix (Either Int) -> Fix (Either Age)
-TcCoercibleFail.hs:29:8: error:
+TcCoercibleFail.hs:36:8: error:
• Couldn't match representation of type ‘Either
Int (Fix (Either Int))’
with that of ‘()’