https://issues.dlang.org/show_bug.cgi?id=24717
Nick Treleaven <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Summary|alias edge cases |alias edge cases with | |tupleof --- Comment #2 from Nick Treleaven <[email protected]> --- > alias y = s.tupleof[0]; // this is a compile error?! Inside a function, `.tupleof` on a struct/static array instance should be implemented as a symbol sequence of implicit ref declarations: struct S { int i; char c; } void main() { S s = {2, 'c'}; ref __si = s.i; ref __sc = s.c; alias tupleof = AliasSeq!(__si, __sc); // should be the same as s.tupleof alias a = tupleof[0]; // works a++; assert(s.i == 3); alias z = AliasSeq!tupleof; // works assert(++z[0] == 4); } > alias z = AliasSeq!(s.tupleof); // error, but it should be a no-op That line doesn't error, but using z does: z[0].writeln(); // Error: accessing non-static variable `x` requires an instance of `S` --
