Skip to content
Snippets Groups Projects
Commit 9612e91c authored by Richard Eisenberg's avatar Richard Eisenberg Committed by Marge Bot
Browse files

Solve constraints from top-level groups sooner

Previously, all constraints from all top-level groups (as
separated by top-level splices) were lumped together and solved
at the end. This could leak metavariables to TH, though, and
that's bad. This patch solves each group's constraints before
running the next group's splice.

Naturally, we now report fewer errors in some cases.

One nice benefit is that this also fixes #11680, but in a much
simpler way than the original fix for that ticket. Admittedly,
the error messages degrade just a bit from the fix from #11680
(previously, we informed users about variables that will be
brought into scope below a top-level splice, and now we just
report an out-of-scope error), but the amount of complexity
required throughout GHC to get that error was just not worth it.

This patch thus reverts much of
f93c9517.

Fixes #16980

Test cases: th/T16980{,a}
parent bf02c264
No related branches found
No related tags found
No related merge requests found
Showing
with 123 additions and 463 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment