[commit: ghc] ghc-8.0: Fix suggestions for unbound variables (#11680) (f93c951)
git at git.haskell.org
git at git.haskell.org
Sun Apr 10 22:17:09 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/f93c9517a2c6e158e4a5c5bc7a3d3f88cb4ed119/ghc
>---------------------------------------------------------------
commit f93c9517a2c6e158e4a5c5bc7a3d3f88cb4ed119
Author: Jason Eisenberg <jasoneisenberg at gmail.com>
Date: Sun Apr 10 19:17:46 2016 +0200
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
(cherry picked from commit 470d4d5b8e7cbcc176b1f3ac26ce0d95acd35a78)
>---------------------------------------------------------------
f93c9517a2c6e158e4a5c5bc7a3d3f88cb4ed119
compiler/basicTypes/OccName.hs | 1 +
compiler/basicTypes/RdrName.hs | 10 +-
compiler/deSugar/DsMeta.hs | 4 +-
compiler/hsSyn/HsExpr.hs | 105 +++++++++++++++++--
compiler/rename/RnExpr.hs | 8 +-
compiler/rename/RnSource.hs | 2 +-
compiler/rename/RnTypes.hs | 6 +-
compiler/typecheck/TcCanonical.hs | 12 +--
compiler/typecheck/TcErrors.hs | 209 +++++++++++++++++++++++++++++++++-----
compiler/typecheck/TcExpr.hs | 10 +-
compiler/typecheck/TcHsSyn.hs | 3 +-
compiler/typecheck/TcRnDriver.hs | 9 +-
compiler/typecheck/TcRnMonad.hs | 24 ++++-
compiler/typecheck/TcRnTypes.hs | 56 ++++++----
testsuite/tests/th/T11680.hs | 122 ++++++++++++++++++++++
testsuite/tests/th/T11680.stderr | 49 +++++++++
testsuite/tests/th/all.T | 2 +
17 files changed, 547 insertions(+), 85 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f93c9517a2c6e158e4a5c5bc7a3d3f88cb4ed119
More information about the ghc-commits
mailing list