This code doesn't work in dmd-beta/dmd-nightly, but work in dmd 2.085.1: ------------------ struct Test { template Temp(int x) { enum xxx = x; } } void main() { import std.stdio; alias TT1 = Test.Temp; writeln(TT1!1.xxx); // Expect the same behavior as above, // but in fact, an error occurs. /* Error: __traits(getMember, Test, "Temp") does not give a valid type */ alias TT2 = __traits(getMember, Test, "Temp"); writeln(TT2!2.xxx); } ------------------
By extension this also breaks things like getSymbolsByUDA whenever there's a template. https://run.dlang.io/is/wpuGoo
@kubo39 created dlang/dmd pull request #9723 "Fix Issue 19833 - The member as template cannot be acquired by getMember" fixing this issue: - Fix Issue 19833 - The member as template cannot be acquired by getMember https://github.com/dlang/dmd/pull/9723
I guess regression since https://github.com/dlang/dmd/commit/2af3013860da8f9525cdad7fa17092c2629bf2e0
dlang/dmd pull request #9723 "Fix Issue 19833 - The member as template cannot be acquired by getMember" was merged into stable: - 74f850e23a831c231b2346c3aa832488f3ce60ad by Hiroki Noda: Fix Issue 19833 - The member as template cannot be acquired by getMember https://github.com/dlang/dmd/pull/9723