Bug 19833 – The member as template cannot be acquired by getMember
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2019-04-27T09:23:54Z
Last change time
2019-04-29T10:42:47Z
Keywords
pull
Assigned to
No Owner
Creator
SHOO
Comments
Comment #0 by zan77137 — 2019-04-27T09:23:54Z
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);
}
------------------
@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
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