summaryrefslogtreecommitdiff
path: root/compiler/deSugar
diff options
context:
space:
mode:
authorJason Eisenberg <jasoneisenberg@gmail.com>2016-04-10 19:17:46 +0200
committerBen Gamari <ben@smart-cactus.org>2016-04-10 22:58:28 +0200
commit470d4d5b8e7cbcc176b1f3ac26ce0d95acd35a78 (patch)
tree536e3f294da6c76878c1997d28508402b0b4c9cc /compiler/deSugar
parent5a1add134fdb2ab4d91b0f66de1dc89f0cd69354 (diff)
downloadhaskell-470d4d5b8e7cbcc176b1f3ac26ce0d95acd35a78.tar.gz
Fix suggestions for unbound variables (#11680)
When the typechecker generates the error message for an out-of-scope variable, it now uses the GlobalRdrEnv with respect to which the variable is unbound, not the GlobalRdrEnv which is available at the time the error is reported. Doing so ensures we do not provide suggestions which themselves are out-of-scope (because they are bound in a later inter-splice group). Nonetheless, we do note in the error message if an unambiguous, exact match to the out-of-scope variable is found in a later inter-splice group, and we specify where that match is not in scope. Test Plan: ./validate Reviewers: goldfire, austin, bgamari Reviewed By: goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2000 GHC Trac Issues: #11680
Diffstat (limited to 'compiler/deSugar')
-rw-r--r--compiler/deSugar/DsMeta.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs
index 84f1a9ca58..b14c0a4bf5 100644
--- a/compiler/deSugar/DsMeta.hs
+++ b/compiler/deSugar/DsMeta.hs
@@ -1179,8 +1179,8 @@ repE (ArithSeq _ _ aseq) =
repE (HsSpliceE splice) = repSplice splice
repE (HsStatic e) = repLE e >>= rep2 staticEName . (:[]) . unC
-repE (HsUnboundVar name) = do
- occ <- occNameLit name
+repE (HsUnboundVar uv) = do
+ occ <- occNameLit (unboundVarOcc uv)
sname <- repNameS occ
repUnboundVar sname