Bug 14089 – [REG2.064] Assigning to AA has no value when overriding opAssign

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-31T15:43:00Z
Last change time
2015-02-03T21:18:15Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
sinkuupump

Comments

Comment #0 by sinkuupump — 2015-01-31T15:43:11Z
Introduced in: https://github.com/D-Programming-Language/dmd/pull/2539 void test() { Test[int] aa; Test b = aa[1] = Test(); } struct Test { Test opAssign(Test val) // ok if remove this { return this; } } $ dmd test.d test.d(4): Error: expression 1 in aa ? aa[1].opAssign(Test()) : cast(void)(aa[1] = Test()) is void and has no value
Comment #1 by sinkuupump — 2015-02-01T00:51:04Z
The behavior of AA assign before 2.064 was just returning rhs. But I noticed this is confusing as I unintentionally showed in #0(result of opAssign vs rhs). Please close this issue if the new behavior is intended.
Comment #2 by k.hara.pg — 2015-02-01T12:43:57Z
It was sadly disabled for the issue 6178 fix. I'll re-enable it. https://github.com/D-Programming-Language/dmd/pull/4366
Comment #3 by sinkuupump — 2015-02-01T12:57:26Z
I see, thanks.
Comment #4 by github-bugzilla — 2015-02-03T21:18:15Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2cb172f8b148097e5d088fe7edef8212964d7aed fix Issue 14089 - Assigning to AA has no value when overriding opAssign https://github.com/D-Programming-Language/dmd/commit/a7561373508a39869427b2c2f0c289d80f2219d9 Merge pull request #4366 from 9rnsr/fix14089 [REG2.064] Issue 14089 - Assigning to AA has no value when overriding opAssign