diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-12-22 10:59:16 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-24 00:42:51 -0500 |
commit | 6d62f6bfbb5a86131e7cbc30993f3fa510d8b3ab (patch) | |
tree | e888f791533511ce762e8768ba4790772c3b7ce7 /testsuite/tests/plugins | |
parent | f42ba88fd32f1def7dcf02f0a2227b453bf5971c (diff) | |
download | haskell-6d62f6bfbb5a86131e7cbc30993f3fa510d8b3ab.tar.gz |
Store RdrName rather than OccName in Holes
In #20472 it was pointed out that you couldn't defer out of scope but
the implementation collapsed a RdrName into an OccName to stuff it into
a Hole. This leads to the error message for a deferred qualified name
dropping the qualification which affects the quality of the error
message.
This commit adds a bit more structure to a hole, so a hole can replace a
RdrName without losing information about what that RdrName was. This is
important when printing error messages.
I also added a test which checks the Template Haskell deferral of out of
scope qualified names works properly.
Fixes #22130
Diffstat (limited to 'testsuite/tests/plugins')
-rw-r--r-- | testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs b/testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs index e9f504d92d..3e8cd06a52 100644 --- a/testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs +++ b/testsuite/tests/plugins/hole-fit-plugin/HoleFitPlugin.hs @@ -34,7 +34,7 @@ fromModule _ = [] toHoleFitCommand :: TypedHole -> String -> Maybe String toHoleFitCommand (TypedHole {th_hole = Just (Hole { hole_occ = h })}) str - = stripPrefix ("_" <> str) $ occNameString h + = stripPrefix ("_" <> str) $ occNameString (occName h) toHoleFitCommand _ _ = Nothing |