Opened 5 years ago

Last modified 4 years ago

#9702 new feature request

Offer a weaker name shadowing warning

Reported by: dfeuer Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.9
Keywords: warning, module Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Suppose I have a module

module Survive where
import HuntGather

flounder = goFishing river
    goFishing = ...

If the maintainer of HuntGather decides to add a goFishing function, my module will suddenly get a name shadowing warning, although there is little risk of confusion. So I think it makes a lot of sense to offer, at least, a version that ignores shadowing of *implicitly imported* names, and to use this for -Wall instead of the current version. Another step down would be to ignore shadowing of all top-level names, but having three levels of name shadowing warning would be too much trouble by far.

Change History (3)

comment:1 Changed 5 years ago by simonpj

I'm not strongly against, if someone wants to offer a patch, but I'd prefer to see a bunch of people saying "oh yes I'd like that".


comment:2 Changed 5 years ago by goldfire

I think this is very related to the discussion started here. I think that discussion should reach some conclusion before deciding what to do with this ticket.

Personally, I'm in favor of taking some action like the one proposed here and/or in that thread, but I haven't found just the right proposal to champion.

comment:3 Changed 4 years ago by thomie

Type of failure: None/UnknownIncorrect warning at compile-time
Note: See TracTickets for help on using tickets.