http://d.puremagic.com/issues/show_bug.cgi?id=9630
--- Comment #6 from Kenji Hara <[email protected]> 2013-03-01 21:49:19 PST --- (In reply to comment #5) > Well, the observable effect is inconsistent and makes no sense: > someInt.max works, but someArrayOfInt[0].max doesn't. > The tests included with the pull do not test attributes of array elements, > only > of individual fields and concatenation with arrays, so I'm quite sure it's a > bug. That is mostly intended. The introduced rule by pull 1687 is: 1. In expr.aStaticMember exists, if expr is just a variable that needs this, it is specially treated as typeof(expr).someStaticMember. This is useful for Type.field.init, Type.field.offsetof, etc. 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 #2 is introduced by @dawgfoto's comment. https://github.com/D-Programming-Language/dmd/pull/1687#issuecomment-14090801 In original code, index access `i[0]` does not fit to above rule. So it will raise "need this" error normally. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
