[Issue 17219] variable shadowing and overload sets

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Feb 23 07:18:07 PST 2017


https://issues.dlang.org/show_bug.cgi?id=17219

--- Comment #1 from John Colvin <john.loughran.colvin at gmail.com> ---
One also gets this weirdness:

void foo(alias bar)()
{
    static int bar0(T...)(T t) { return 0; }
    alias bar = bar0;
    pragma(msg, __traits(identifier, __traits(parent, bar!int)));
    pragma(msg, __traits(identifier, __traits(parent, __traits(parent,
bar!int))));
}

int blah(T)(T t) { return 1; }

void main()
{
    foo!blah;
}

output:
bar0
bar0

I.e. __traits(parent, ...) ends up idempotent.

--


More information about the Digitalmars-d-bugs mailing list