[GHC] #15611: scope errors lie about what modules are imported
#15611: scope errors lie about what modules are imported -------------------------------------+------------------------------------- Reporter: dmwit | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Here's Test.hs: {{{ module Test where }}} And here's a ghci session: {{{ % ghci Test.hs GHCi, version 8.4.2: http://www.haskell.org/ghc/ :? for help *Test> Test.foo <interactive>:1:1: error: Not in scope: ‘Test.foo’ No module named ‘Test’ is imported. }}} That "No module named ‘Test’ is imported." part seems blatantly wrong (and persists even if I explicitly `import Test` rather than using the implicit loading of the module). -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15611: scope errors lie about what modules are imported -------------------------------------+------------------------------------- Reporter: dmwit | Owner: RolandSenn Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * owner: (none) => RolandSenn Comment: I'll work on this. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15611: scope errors lie about what modules are imported -------------------------------------+------------------------------------- Reporter: dmwit | Owner: RolandSenn Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #14225 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * related: => #14225 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15611: scope errors lie about what modules are imported -------------------------------------+------------------------------------- Reporter: dmwit | Owner: RolandSenn Type: bug | Status: patch Priority: normal | Milestone: 8.6.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: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * status: new => patch * testcase: => make test TEST="T15611a T15611b" * differential: => Phab:D5284 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * milestone: 8.6.1 => 8.8.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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
#15611: scope errors lie about what modules are imported -------------------------------------+------------------------------------- Reporter: dmwit | Owner: RolandSenn Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.2 Resolution: fixed | 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: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15611: scope errors lie about what modules are imported -------------------------------------+------------------------------------- Reporter: dmwit | Owner: (none) Type: bug | Status: new 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: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * owner: RolandSenn => (none) * status: closed => new * resolution: fixed => Comment: While working on #14225 I discoverd that in patch Phab:D5284 I didn't respect the local naming conventions of module [https://github.com/ghc/ghc/blob/cad5d0b69bc039b635a6eb0e5c9ed47d7c5a38ed/com...]: - Top level functions names are in ''camelCase''. - Local function names in where clauses are ''hyphenated-names''. I reopen the ticket to fix this! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15611: scope errors lie about what modules are imported -------------------------------------+------------------------------------- Reporter: dmwit | Owner: RolandSenn Type: bug | Status: new 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: | -------------------------------------+------------------------------------- Changes (by RolandSenn): * owner: (none) => RolandSenn -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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: | Phab:D5308 -------------------------------------+------------------------------------- Changes (by RolandSenn): * status: new => patch * differential: Phab:D5284 => Phab:D5284 Phab:D5308 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#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: | Phab:D5308 -------------------------------------+------------------------------------- Comment (by Krzysztof Gogolewski <krz.gogolewski@…>): In [changeset:"98f8e1c2454b8c99cbb225e4a8a544288eeb082a/ghc" 98f8e1c2/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="98f8e1c2454b8c99cbb225e4a8a544288eeb082a" Respect naming conventions in module RnUnbound.hs in fix for #15611 Summary: The patch https://phabricator.haskell.org/D5284 didn't respect the local naming conventions in module compiler/rename/RnUnbound.hs: - Top level functions names are written in camelCase. - Local function names in where clauses are written as names_with_underscores. This patch restores these conventions. Test Plan: make test TESTS="T15611a T15611b" Reviewers: DavidEichmann, monoidal, hvr, mpickering, bgamari Reviewed By: mpickering Subscribers: rwbarton, carter GHC Trac Issues: #15611 Differential Revision: https://phabricator.haskell.org/D5308 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15611: scope errors lie about what modules are imported -------------------------------------+------------------------------------- Reporter: dmwit | Owner: RolandSenn Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.4.2 Resolution: fixed | 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: | Phab:D5308 -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15611#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC