#11680: Out-of-scope suggestion given for an out-of-scope variable when using TH -------------------------------------+------------------------------------- Reporter: jme | Owner: jme Type: bug | Status: patch Priority: normal | Milestone: Component: Template Haskell | Version: 8.0.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2000 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"470d4d5b8e7cbcc176b1f3ac26ce0d95acd35a78/ghc" 470d4d5b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="470d4d5b8e7cbcc176b1f3ac26ce0d95acd35a78" 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 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11680#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler