Skip to content

Draft: Improvements to the Solver's "too many iterations" error (#19627)

A fix for #19627 (closed)

  • Dont print the entire WantedConstraints This was arguably of no (direct) help to the user The entire WantedConstraints can be obtained from -ddump-tc-trace

    Now only the first few (4) "unsolved" constraints are printed

  • Reword the message to be a bit more explanatory than before

  • Limit the error message to one

Here is how it looks now

src/Linear/Logic/Internal.hs:1:1: error:
    Solver exceeded the max iteration limit (= 4) for the following constraints (non-exhaustive)
      Unsolved: [[WD] $dIProp'_a4Wz {1}:: IProp'
                                            (INot f) (CDictCan(psc)),
                 [WD] $dIProp'_a4WA {1}:: IProp' (INot g) (CDictCan(psc))]
    Suggested fix:
      Set limit with -fconstraint-solver-iterations=n; n=0 for no limit
  |
1 | {-# language BlockArguments #-}
  | ^

src/Linear/Logic/Internal.hs:419:10: error:
    • Could not deduce (IProp' (INot g))
        arising from the superclasses of an instance declaration
      from the context: IProp' g
        bound by the instance declaration
        at src/Linear/Logic/Internal.hs:419:10-37
    • In the instance declaration for ‘Prop (DWith f g)’
    |
419 | instance IProp' g => Prop (DWith f g) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Edited by Andreas Klebinger

Merge request reports