[GHC] #15611: scope errors lie about what modules are imported
GHC
ghc-devs at haskell.org
Sun Nov 4 16:56:06 UTC 2018
#15611: scope errors lie about what modules are imported
-------------------------------------+-------------------------------------
Reporter: dmwit | Owner: RolandSenn
Type: bug | Status: patch
Priority: normal | Milestone: 8.8.1
Component: Compiler | Version: 8.4.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: make test
| TEST="T15611a T15611b"
Blocked By: | Blocking:
Related Tickets: #14225 | Differential Rev(s): Phab:D5284
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Krzysztof Gogolewski <krz.gogolewski@…>):
In [changeset:"1a3b9bd0b674ad16a41b942c738b8f34564bcd8d/ghc"
1a3b9bd0/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="1a3b9bd0b674ad16a41b942c738b8f34564bcd8d"
Fix for Trac #15611: Scope errors lie about what modules are imported.
Summary:
For the error message:
Not in scope X.Y
Module X does not export Y
No module named ‘X’ is imported:
there are 2 cases, where we don't show the last "no module named is
imported" line:
1. If the module X has been imported.
2. If the module X is the current module. There are 2 subcases:
2.1 If the unknown module name is in a input source file,
then we can use the getModule function to get the current module
name.
2.2 If the unknown module name has been entered by the user in GHCi,
then the getModule function returns something like
"interactive:Ghci1",
and we have to check the current module in the last added entry of
the HomePackageTable.
Test Plan: make test TESTS="T15611a T15611b"
Reviewers: monoidal, hvr, thomie, dfeuer, bgamari, DavidEichmann
Reviewed By: monoidal, DavidEichmann
Subscribers: rwbarton, carter
GHC Trac Issues: #15611
Differential Revision: https://phabricator.haskell.org/D5284
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list