[GHC] #4983: Warning about redundant import is wrong when hiding identifiers in order to avoid export ambiguities

GHC ghc-devs at haskell.org
Sun Sep 8 19:09:57 CEST 2013


#4983: Warning about redundant import is wrong when hiding identifiers in order to
avoid export ambiguities
-------------------------------------------------+-------------------------
        Reporter:  Lemming                       |            Owner:
            Type:  bug                           |           Status:
        Priority:  normal                        |  closed
       Component:  Compiler                      |        Milestone:
      Resolution:  wontfix                       |          Version:  7.0.1
Operating System:  Unknown/Multiple              |         Keywords:
 Type of failure:  Incorrect warning at          |     Architecture:
  compile-time                                   |  Unknown/Multiple
       Test Case:                                |       Difficulty:
        Blocking:                                |  Unknown
                                                 |       Blocked By:
                                                 |  Related Tickets:
-------------------------------------------------+-------------------------

Comment (by Lemming):

 Replying to [comment:4 simonpj]:
 > Well that would apply to any other redundant import too.   I suppose we
 could replace "The import of M is redundant" by "You imported M but used
 nothing of it".  Maybe that'd be an improvement, I'm not sure.

 I have thought about the question, whether "redundant import" and "you
 used nothing of it" are synonyms or not. I think they are not. "Redundant
 import" means you can omit the import. "You used nothing of it" means erm
 that you used nothing from the module. Usually these two statements
 coincide. But since Prelude is imported automatically this is a corner
 case where the two statements are different. "You used nothing of it" is
 true in both the regular case and this corner case, whereas "redundant
 import" is only true in the regular case.

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




More information about the ghc-tickets mailing list