Skip to content
  • Richard Eisenberg's avatar
    Solve constraints from top-level groups sooner · 9612e91c
    Richard Eisenberg authored and Marge Bot's avatar Marge Bot committed
    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}
    9612e91c