Summary: [Regression 2.054] 'pure' does not work with member of
                    array of aggregrate
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-07-12 01:38:45 PDT ---
Test case
class C6293 {
    int token;
struct S6293 {
    const(C6293)[] tokens;
    void f() const pure {
        const(C6293) a = tokens[0];
        int b = a.token;           // <-- separating it is ok.
        int c = tokens[0].token;   // <-- cannot access mutable data 'token'
x.d(9): Error: pure nested function 'f' cannot access mutable data 'token'

If that 'b' can be accessed in a 'pure' function, there's no reason 'c' cannot.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to