http://d.puremagic.com/issues/show_bug.cgi?id=9630
--- Comment #11 from Kenji Hara <[email protected]> 2013-03-01 22:15:23 PST --- (In reply to comment #6) > 2. In expr.aFieldVariable, if expr is just a variable that needs this, the > "need this" error for aFieldVariable access is specially delayed. > > This is more specialized 'exception' than #1. > The chain of field access like following would be accepted by this. > > Type.field1.field2.field3.staticFieldOrFunction Why it is explicitly allowed? The reason of rule #2 is "a variable access can be regarded as a symbol access". For example, symbol access is already allowed in template argument. template X(alias symbol) {} struct S { T field1; struct T { int field2; } } void main() { alias x = X!(S.field1.field2); // access symbol S.T.field2 auto y = S.field1.field2.offsetof; // access symbol S.T.field2 } This is consistent behavior. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
