https://issues.dlang.org/show_bug.cgi?id=20884
Mathias LANG <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED CC| |[email protected] Resolution|FIXED |--- --- Comment #3 from Mathias LANG <[email protected]> --- This wasn't fully fixed. Ran into this one today: ``` pragma(msg, __VERSION__); template FieldRef (T, string name) { alias Ref = __traits(getMember, T, name); alias Type1 = typeof(Ref); alias Type2 = typeof(__traits(getMember, T, name)); pragma(msg, "Instantiating FieldRef: ", T, ".", name, " => ", Type1, " versus ", Type2); } struct Config { Inner inner; } struct Inner { char[] value; } alias IConfig = immutable(Config); alias Result = FieldRef!(IConfig, `inner`); alias ResultBis = FieldRef!(Result.Type2, "value"); ``` Result: ``` 2098L Instantiating FieldRef: immutable(Config).inner => Inner versus immutable(Inner) Instantiating FieldRef: immutable(Inner).value => char[] versus immutable(string) ``` As you can see, using the `__traits` directly works, but using an `alias` to the `__traits` still has the bug. This was tested with nightly (2.098), the aforementioned PR was released in v2.092. --
