[GHC] #11071: "Not in scope" errors should be more informative for qualified names. (was: The "Not in scope" error is misleading)

GHC ghc-devs at haskell.org
Sun Nov 8 22:39:11 UTC 2015


#11071: "Not in scope" errors should be more informative for qualified names.
-------------------------------------+-------------------------------------
        Reporter:  mojojojo          |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.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 nomeata):

 * type:  bug => feature request


Comment:

 No need to get excited. We have a track of giving rather verbose error
 messages that try to convey as much information as possible to the user.
 So simply add any useful additional information, such as:

 {{{
     Not in scope: ‘Maybe.maybeToList’
     No Module named Maybe is imported.
 }}}
 or
 {{{
     Not in scope: ‘Maybe.maybeToList’
     Module `Maybe` does not provide `maybeToList`
 }}}
 or
 {{{
     Not in scope: ‘Maybe.maybeToList’
     Your import of `Maybe` explicitly hides `maybeToList`.
 }}}
 for the three cases I can think of why some `Foo.bar` is not in scope.

 This would indeed be useful, and helpful in any case.

 It’s also not completely trivial, as there is a many-to-many mapping of
 modules and modules name in scope, due to qualified imports.

 Nevertheless, this looks like a nice newcomer task.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11071#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list