Re: [GHC] #8466: Aggregate “ambiguous import” errors for the same name

GHC ghc-devs at haskell.org
Thu Oct 24 20:33:53 UTC 2013


#8466: Aggregate “ambiguous import” errors for the same name
-------------------------------------+------------------------------------
        Reporter:  nomeata           |            Owner:
            Type:  feature request   |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.6.3
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by nomeata):

 I gave it a shot in 132a3d8fa5a018fec927ada0ae1c0eb6e4a5a1d5, now instead
 of

 {{{
 $ ghc Errors.hs
 [1 of 1] Compiling Main             ( Errors.hs, Errors.o )

 Errors.hs:1:6: Not in scope: `foo'

 Errors.hs:3:6: Not in scope: `bar'

 Errors.hs:5:7: Not in scope: `foo'

 Errors.hs:5:11: Not in scope: `foo'
 }}}
 we’d get
 {{{
 $ ./inplace/bin/ghc-stage2 Errors.hs
 [1 of 1] Compiling Main             ( Errors.hs, Errors.o )

 Errors.hs:1:6:
     Not in scope: ‛foo’
     (also at Errors.hs:5:7-9, Errors.hs:5:11-13)

 Errors.hs:3:6: Not in scope: ‛bar’
 }}}
 which I believe is an improvement, at least for our human consumers of
 error messages.

 It’s not ready to be merged, though: Not all fields of an `ErrMsg` have an
 `Eq` instance. In particular, this code merges error messages if their
 `errMsgShortString` and severity agree, even if `errMsgExtraInfo` (which
 is an `SDoc`) and `errMsgMsgContext` differ. I have not yet seen enough of
 GHC’s code to assess if that is sufficient, or if there is a risk of
 throwing away important information.

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


More information about the ghc-tickets mailing list