[commit: ghc] master: Increase -fcontext-stack=N default to 100 (c96c64f)

git at git.haskell.org git at git.haskell.org
Fri Sep 19 11:30:37 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c96c64fae0152bc53f48634d0ddd310ef4bc0105/ghc

>---------------------------------------------------------------

commit c96c64fae0152bc53f48634d0ddd310ef4bc0105
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Sep 9 12:52:18 2014 +0100

    Increase -fcontext-stack=N default to 100
    
    This addresses Trac #5395


>---------------------------------------------------------------

c96c64fae0152bc53f48634d0ddd310ef4bc0105
 compiler/main/Constants.lhs                          |  3 ++-
 docs/users_guide/flags.xml                           |  2 +-
 .../typecheck/should_fail/TcCoercibleFail.stderr     | 20 +++++++++++++-------
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/compiler/main/Constants.lhs b/compiler/main/Constants.lhs
index a891336..ee126f5 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 086157b..bd2a84c 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 2851bcd..5bb9210 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) -> ()



More information about the ghc-commits mailing list