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