Is this a known issue in Phobos/DMD?
Jonathan M Davis
jmdavisProg at gmx.com
Sun Jan 6 12:23:49 PST 2013
On Sunday, January 06, 2013 15:15:42 Chris wrote:
> This means that the local variable still has precedence over the
> imported one. However, if it is inside the function the imported
> variable is treated as local, as in "last one in closes the door"?
Which is wrong behavior. Local variables should _never_ be shadowed. It's not
ever legal anymore to shadow a local variable with another local variable in a
larger scope within the function. The only difference between an import outside
of a function and one inside is that the symbols should only be imported for
the duration of the function. There should be _zero_ other effects on any other
language features (be they variable shadowing, symbol collisions, UFCS, etc.).
This is definitely a bug. I know that one has already been reported for UFCS,
so we already have reported bugs like this, though we probably haven't found
them all (and I have no idea whether this particular one has been reported
yet).
- Jonathan M Davis
More information about the Digitalmars-d
mailing list