summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
authorApoorv Ingle <apoorv-ingle@uiowa.edu>2023-03-08 10:50:34 -0600
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-03-09 09:52:45 -0500
commit9ea719f2f1929bf2b789e4001f6c542a04185d61 (patch)
tree5baef79710e85a60cab3658c4b03fe1f0a3caa6e /compiler/GHC
parentf97c7f6d96c58579d630bc883929afc3d45d5c2b (diff)
downloadhaskell-9ea719f2f1929bf2b789e4001f6c542a04185d61.tar.gz
Fixes #19627.
Previously the solver failed with an unhelpful "solver reached too may iterations" error. With the fix for #21909 in place we no longer have the possibility of generating such an error if we have `-fconstraint-solver-iteration` > `-fgivens-fuel > `-fwanteds-fuel`. This is true by default, and the said fix also gives programmers a knob to control how hard the solver should try before giving up. This commit adds: * Reference to ticket #19627 in the Note [Expanding Recursive Superclasses and ExpansionFuel] * Test `typecheck/should_fail/T19627.hs` for regression purposes
Diffstat (limited to 'compiler/GHC')
-rw-r--r--compiler/GHC/Tc/Solver.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Solver.hs b/compiler/GHC/Tc/Solver.hs
index 81fa86aea4..fad6cbae4f 100644
--- a/compiler/GHC/Tc/Solver.hs
+++ b/compiler/GHC/Tc/Solver.hs
@@ -2371,7 +2371,7 @@ any new unifications, and iterate the implications only if so.
-}
{- Note [Expanding Recursive Superclasses and ExpansionFuel]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider the class declaration (T21909)
class C [a] => C a where
@@ -2431,7 +2431,7 @@ There are two preconditions for the default fuel values:
Precondition (1) ensures that we expand givens at least as many times as we expand wanted constraints
preferably givenFuel > wantedsFuel to avoid issues like T21909 while
the precondition (2) ensures that we do not reach the solver iteration limit and fail with a
-more meaningful error message
+more meaningful error message (see T19627)
This also applies for quantified constraints; see `-fqcs-fuel` compiler flag and `QCI.qci_pend_sc` field.
-}