import std.stdio; struct F { int[] g; alias g this; auto ptr() { return g.ptr; write("ptr\n"); } } void main() { F a; auto p = a.ptr; } prints nothing even though ptr method should override g's .ptr
This is sample-code bug. import std.stdio; struct F { int[] g; alias g this; auto ptr() { write("ptr\n"); // print before return return g.ptr; } } void main() { F a; auto p = a.ptr; }
How embarrassing.
Never mind!