summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2014-09-09 12:52:18 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2014-09-19 11:41:11 +0100
commitc96c64fae0152bc53f48634d0ddd310ef4bc0105 (patch)
tree22945c000a026ea6979e311f63f33f5399fa85dc
parentfdc03a78ab1b3c03e4d1757fca062eaf7a47834a (diff)
downloadhaskell-c96c64fae0152bc53f48634d0ddd310ef4bc0105.tar.gz
Increase -fcontext-stack=N default to 100
This addresses Trac #5395
-rw-r--r--compiler/main/Constants.lhs3
-rw-r--r--docs/users_guide/flags.xml2
-rw-r--r--testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr20
3 files changed, 16 insertions, 9 deletions
diff --git a/compiler/main/Constants.lhs b/compiler/main/Constants.lhs
index a891336e53..ee126f5b20 100644
--- a/compiler/main/Constants.lhs
+++ b/compiler/main/Constants.lhs
@@ -18,7 +18,8 @@ mAX_TUPLE_SIZE = 62 -- Should really match the number
-- of decls in Data.Tuple
mAX_CONTEXT_REDUCTION_DEPTH :: Int
-mAX_CONTEXT_REDUCTION_DEPTH = 20
+mAX_CONTEXT_REDUCTION_DEPTH = 100
+ -- Trac #5395 reports at least one library that needs depth 37 here
mAX_TYPE_FUNCTION_REDUCTION_DEPTH :: Int
mAX_TYPE_FUNCTION_REDUCTION_DEPTH = 200
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index 086157be1b..bd2a84c2ec 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -706,7 +706,7 @@
<tbody>
<row>
<entry><option>-fcontext-stack=N</option><replaceable>n</replaceable></entry>
- <entry>set the <link linkend="undecidable-instances">limit for context reduction</link>. Default is 20.</entry>
+ <entry>set the <link linkend="undecidable-instances">limit for type-class context reduction</link>. Default is 100.</entry>
<entry>dynamic</entry>
<entry></entry>
</row>
diff --git a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
index 2851bcd934..5bb9210a13 100644
--- a/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
+++ b/testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
@@ -1,7 +1,9 @@
TcCoercibleFail.hs:11:8:
Could not coerce from ‘Int’ to ‘()’
- because ‘Int’ and ‘()’ are different types.
+ because ‘Int’
+ and ‘()’
+ are different types.
arising from a use of ‘coerce’
In the expression: coerce
In the expression: coerce $ one :: ()
@@ -9,7 +11,9 @@ TcCoercibleFail.hs:11:8:
TcCoercibleFail.hs:14:8:
Could not coerce from ‘m Int’ to ‘m Age’
- because ‘m Int’ and ‘m Age’ are different types.
+ because ‘m Int’
+ and ‘m Age’
+ are different types.
arising from a use of ‘coerce’
from the context (Monad m)
bound by the type signature for foo2 :: Monad m => m Age
@@ -36,24 +40,26 @@ TcCoercibleFail.hs:18:8:
In an equation for ‘foo4’: foo4 = coerce $ one :: Down Int
TcCoercibleFail.hs:21:8:
- Context reduction stack overflow; size = 21
+ Context reduction stack overflow; size = 101
Use -fcontext-stack=N to increase stack size to N
Coercible Void ()
In the expression: coerce :: Void -> ()
In an equation for ‘foo5’: foo5 = coerce :: Void -> ()
TcCoercibleFail.hs:30:8:
- Context reduction stack overflow; size = 21
+ Context reduction stack overflow; size = 101
Use -fcontext-stack=N to increase stack size to N
- Coercible Int Age
+ Coercible
+ (Either Int (Fix (Either Int))) (Either Age (Fix (Either Age)))
In the expression: coerce :: Fix (Either Int) -> Fix (Either Age)
In an equation for ‘foo6’:
foo6 = coerce :: Fix (Either Int) -> Fix (Either Age)
TcCoercibleFail.hs:31:8:
Could not coerce from ‘Either Int (Fix (Either Int))’ to ‘()’
- because ‘Either
- Int (Fix (Either Int))’ and ‘()’ are different types.
+ because ‘Either Int (Fix (Either Int))’
+ and ‘()’
+ are different types.
arising from a use of ‘coerce’
In the expression: coerce :: Fix (Either Int) -> ()
In an equation for ‘foo7’: foo7 = coerce :: Fix (Either Int) -> ()