On Sunday, 24 November 2013 at 18:23:51 UTC, Walter Bright wrote:
Shadowing globals is definitely a bad idea. Shadowing members, it's debatable. In any case, I don't think it is some sort of terrible bug generator. In fact, I'll often write:

struct S {
    int m;
    this(int m) { this.m = m; }
}

We can allow shadowing members only for function parameters or, maybe, only for constructor. Probably, your example is the most often case usage of shadowing members. In other hand, I can always rename local function variable because it isn't part of public API and should not confuse any users.

Reply via email to