Bug 16758 – Variant.opIndex result not modified after opAssign
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2016-11-24T15:38:00Z
Last change time
2017-07-23T11:30:22Z
Assigned to
nobody
Creator
nick
Comments
Comment #0 by nick — 2016-11-24T15:38:50Z
import std.variant;
Variant a = new int[1];
a[0] += 5;
assert(a[0] == 5); // fails
This is documented, but can be fixed by implementing opIndexOpAssign.
PR pending.
Comment #1 by github-bugzilla — 2016-12-06T13:46:49Z
@Erdem: Why did you reopen this?
It works fine for me. See for yourself:
https://is.gd/ZwMquz
If you have run into a similar issue, please open a new issue. Thanks!
Comment #6 by farukerdemoncel — 2017-07-23T11:30:22Z
@greenify: Sorry this was a mistake. I accidentally reopened this.