[Issue 19833] New: The member as template cannot be acquired by getMember
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Apr 27 09:23:54 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19833
Issue ID: 19833
Summary: The member as template cannot be acquired by getMember
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: zan77137 at nifty.com
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);
}
------------------
--
More information about the Digitalmars-d-bugs
mailing list