template instantiation problems

Boris Carvajal boris2.9 at gmail.com
Wed Jan 15 06:58:14 UTC 2020


On Friday, 10 January 2020 at 18:31:59 UTC, ag0aep6g wrote:
> ----
> import m1 = foo.baz;
> import m2 = foo;
> alias p = __traits(parent, m1);
>
> pragma(msg, m1.stringof); /* "module baz", ok */
> pragma(msg, m2.stringof); /* "module foo", ok */
> pragma(msg, p.stringof); /* "package foo", ok */
>
> enum e(alias thing) = thing.stringof;
>
> pragma(msg, e!m1); /* "module baz", ok */
> pragma(msg, e!m2); /* "module foo", ok */
> pragma(msg, e!p); /* "module foo", wat?? */
> ----

Thanks for your test case.

https://github.com/dlang/dmd/pull/10724



More information about the Digitalmars-d-learn mailing list