Bug 13354 – Algebraic.opIndex/opIndexAssign makes wrong assumptions on the index/value type
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2014-08-22T10:24:00Z
Last change time
2014-09-06T16:44:41Z
Keywords
pull
Assigned to
nobody
Creator
sludwig
Comments
Comment #0 by sludwig — 2014-08-22T10:24:37Z
Currently both, the index and the value type for VariantN.opIndex(Assign) must
be allowed!T. This is an unreasonable assumption for Algebraic and examples
such as the following do not work because of this:
---
alias T = Algebraic!(int[string], int[]);
T v = ["a": 1, "b": 2];
assert(v["a"] == 1); // error
v["a"] = 0; // error
---