[Issue 4496] New: aa.get broken when using get and opIndexAssign in same statement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 23 13:55:13 PDT 2010


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

           Summary: aa.get broken when using get and opIndexAssign in same
                    statement
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: sean at invisibleduck.org
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2010-07-23 13:55:05 PDT ---
import std.stdio, std.contracts, std.conv;

void main() {
    int[string] aa;
    aa["foo"] = aa.get("foo", 5);

    // This fails because aa["foo"] ends up being 0.
    enforce(aa["foo"] == 5, text(aa["foo"]));
}

-- 
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