digitalmars.D.bugs - [Issue 15038] New: Associative Array .get property const vs immutable
- via Digitalmars-d-bugs (30/30) Sep 11 2015 https://issues.dlang.org/show_bug.cgi?id=15038
https://issues.dlang.org/show_bug.cgi?id=15038 Issue ID: 15038 Summary: Associative Array .get property const vs immutable Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: luis luismarques.eu An associative array of string[string] can't be indexed with .get using a const(char)[], unlike normal/raw indexing: void main() { string[string] foo = ["k": "v"]; const(char)[] key = "k"; string value; // if this works... assert(foo[key] == "v"); // and this works... string* pValue = key in foo; value = pValue ? *pValue : null; assert(value == "v"); // ...then this should work //assert(foo.get(key, null) == "v"); } --
Sep 11 2015