diff options
author | Richard Eisenberg <rae@richarde.dev> | 2019-09-26 14:31:30 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-08 13:26:20 -0400 |
commit | 9612e91c793830b3049d2bc9a9ee28d9d82b928d (patch) | |
tree | f34d5c1f295026aaf1e706b8e2d20426fad6ac23 /testsuite/tests/plugins | |
parent | bf02c26402cf926d41c006ab930ed9747e92a373 (diff) | |
download | haskell-9612e91c793830b3049d2bc9a9ee28d9d82b928d.tar.gz |
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
f93c9517a2c6e158e4a5c5bc7a3d3f88cb4ed119.
Fixes #16980
Test cases: th/T16980{,a}
Diffstat (limited to 'testsuite/tests/plugins')
-rw-r--r-- | testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs b/testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs index dc6e9762f5..2a04742a53 100644 --- a/testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs +++ b/testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs @@ -34,8 +34,8 @@ fromModule (GreHFCand gre) = fromModule _ = [] toHoleFitCommand :: TypedHole -> String -> Maybe String -toHoleFitCommand TyH{tyHCt = Just (CHoleCan _ h)} str - = stripPrefix ("_" <> str) $ occNameString $ holeOcc h +toHoleFitCommand TyH{tyHCt = Just (CHoleCan _ h _)} str + = stripPrefix ("_" <> str) $ occNameString h toHoleFitCommand _ _ = Nothing |