D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4496 - aa.get broken when using get and opIndexAssign in same statement
Summary: aa.get broken when using get and opIndexAssign in same statement
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: Sean Kelly
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-23 13:55 UTC by David Simcha
Modified: 2011-08-12 20:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2010-07-23 13:55:05 UTC
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"]));
}
Comment 1 David Simcha 2011-08-12 20:39:56 UTC
Fixed at some point in the past.  Can't reproduce anymore.