Skip to content

checkFamApp: don't be so eager to cycle break

sheaf requested to merge sheaf/ghc:T25933 into master

Ticket: #25933 (closed)

As remarked in #25933 (closed), a pure refactoring of checkTyEqRhs in ab77fc8c inadvertently changed behaviour, as it caused GHC to introduce cycle-breaker variables in some unnecessary circumstances.

This MR refactors GHC.Tc.Utils.Unify.checkFamApp in a way that should restore the old behaviour, so that, when possible, we first recur into the arguments and only introduce a cycle breaker if this recursion fails (e.g. due to an occurs check failure).

Merge request reports

Loading