summaryrefslogtreecommitdiff
path: root/testsuite/tests/module
diff options
context:
space:
mode:
authorroland <rsx@bluewin.ch>2018-11-04 16:45:29 +0100
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-11-04 16:45:29 +0100
commit1a3b9bd0b674ad16a41b942c738b8f34564bcd8d (patch)
tree6796e7d78d7c56c1c357dc431a66f35242ffa9f0 /testsuite/tests/module
parent2c959a1894311e59cd2fd469c1967491c1e488f3 (diff)
downloadhaskell-1a3b9bd0b674ad16a41b942c738b8f34564bcd8d.tar.gz
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
Diffstat (limited to 'testsuite/tests/module')
-rw-r--r--testsuite/tests/module/mod62.stderr1
1 files changed, 0 insertions, 1 deletions
diff --git a/testsuite/tests/module/mod62.stderr b/testsuite/tests/module/mod62.stderr
index 3a6f415946..0a2ceff6d9 100644
--- a/testsuite/tests/module/mod62.stderr
+++ b/testsuite/tests/module/mod62.stderr
@@ -4,4 +4,3 @@ mod62.hs:3:9: error: Qualified name in binding position: M.y
mod62.hs:3:22: error:
Not in scope: ‘M.y’
Perhaps you meant ‘M.x’ (line 3)
- No module named ‘M’ is imported.