Bug 7365 – [Regression after 2.057] AAs broken for Object keys and values with opEquals

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-24T17:59:00Z
Last change time
2012-01-30T16:34:08Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2012-01-24T17:59:56Z
Didn't fully track it down yet, but the following program asserts in getImpl (mtype.c, line 4371) because AssociativeArray!(Object, TickDuration) can't be instantiated (DMD 2.058 Git): --- struct TickDuration { bool opEquals(ref const TickDuration rhs) const { return true; } } void main() { TickDuration[Object] aa; aa.keys; } --- Having a look at the gagged errors, it seems like the cause is related to the opEquals const correctness issue: --- Error: function object.opEquals (Object lhs, Object rhs) is not callable using argument types (const(Object),const(Object)) Error: cannot implicitly convert expression (this.key) of type const(Object) to object.Object Error: cannot implicitly convert expression (p.key) of type const(Object) to object.Object --- The error is encountered while generating the default opEquals for the Slot type added in https://github.com/D-Programming-Language/druntime/commit/cd7b477b83cc8a75a90258bd2ab63fa8c92ba10b.
Comment #1 by code — 2012-01-25T10:53:38Z
Forgot to mark as regression.
Comment #2 by github-bugzilla — 2012-01-30T12:35:44Z
Comment #3 by bugzilla — 2012-01-30T12:36:36Z
It works for me, but I added a test case for it anyway to the test suite.
Comment #4 by code — 2012-01-30T12:48:27Z
Seems to WORKSFORME now as well, not sure when it was fixed or what the problem was before…
Comment #5 by code — 2012-01-30T12:51:10Z
Ah, screw it, now the auto-tester fails because of it as well: http://d.puremagic.com/test-results/test_data.ghtml?dataid=146136. Must have inadvertently introduced a workaround in my original client code, sorry for the noise.
Comment #6 by github-bugzilla — 2012-01-30T16:31:00Z
Commit pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/048caceac7c678b16ccd0f6555502a6a622a5ba3 fix Issue 7365 - [Regression after 2.057] AAs broken for Object keys and values with opEquals