Shadowing of members

Maxim Fomin maxim at maxim-fomin.ru
Wed Jan 9 13:22:36 PST 2013


On Wednesday, 9 January 2013 at 20:36:16 UTC, Benjamin Thaut 
wrote:
> <skipped>
> The local variable a shadows the member a after the refactoring 
> and therefore this code will no longer work as expected. This 
> was quite time consuming to track down. So I wanted to ask if 
> we want to prevent that with a warning or even an error? D does 
> not allow shadowing of local variables, so why is it allowed 
> for members?
>
> Kind Regards
> Benjamin Thaut

Because local variable is not a member. However I think this 
should be posted to Bugzilla as a bug or at least as an 
enhancement request.


More information about the Digitalmars-d mailing list