[Issue 1849] with() should cause shadowing errors if you use a member that's shadowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 2 21:48:11 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1849





------- Comment #2 from wbaxter at gmail.com  2008-03-02 23:48 -------
(In reply to comment #1)
> The problem is even if the compiler did generate a warning, it would be
> problematical because one of the whole points of with is to do this (in a
> scoped manner, of course).

You could say the same thing about plain-old {..} scopes, though.  The whole
point of a scope is to create a new (scoped) namespace, and yet D doesn't allow
shadowing in those cases.

At least I don't *think* you're saying that the point of with() is to shadow
variables in outer scopes.  If that's what you're saying then I guess I just
don't really agree that that's a desirable thing.


-- 



More information about the Digitalmars-d-bugs mailing list