• Jason Eisenberg's avatar
    Fix suggestions for unbound variables (#11680) · 470d4d5b
    Jason Eisenberg authored
    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
RnTypes.hs 69.6 KB