[Issue 6267] New: Can't increment alias this'd struct from ref return

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 7 15:52:45 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6267

           Summary: Can't increment alias this'd struct from ref return
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2011-07-07 15:47:41 PDT ---
2.054 beta regression.

struct Double1 {
    double val = 1;
    alias val this;
}

struct DNAHash(T) {
    T[] data;

    this(ubyte width) {}

    ref T opIndex(S)(S seq) {
        return data[0];
    }
}

void main() {
    auto hash = DNAHash!(Double1)(2);
    hash["f"]++;
}

test9.d(18): Error: var has no effect in expression (__pitmp5)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list