Identifier resolution, the great implementation defined mess.
Timon Gehr via Digitalmars-d
digitalmars-d at puremagic.com
Sun Sep 21 14:33:46 PDT 2014
On 09/21/2014 10:08 PM, Walter Bright wrote:
> On 9/21/2014 12:58 PM, Timon Gehr wrote:
>> On 09/21/2014 09:54 PM, Walter Bright wrote:
>>> On 9/21/2014 5:55 AM, Timon Gehr wrote:
>>>> For local imports, DMD imports _all_ symbols into the local scope,
>>>> shadowing
>>>> anything that was there, which is plain broken (as SÓ§nke's example
>>>> shows). BTW:
>>>> how do you suggest to treat the root package? I think importing into
>>>> the local
>>>> scope is fine, but the above example should emit an error because the
>>>> parameter
>>>> and the package conflict.
>>>>
>>>> (The following code does not compile either:
>>>> int std;
>>>> import std.conv;)
>>>
>>> Of course it shouldn't, ...
>>
>> (That was my point.)
>
> Parameters are not in the same scope as local variables.
I know, and you will know that it makes no practical difference since
identifier shadowing is disallowed (deprecated) within a function.
More information about the Digitalmars-d
mailing list