[Issue 7365] New: AAs broken for Object keys and values with opEquals
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Jan 24 17:59:59 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7365
Summary: AAs broken for Object keys and values with opEquals
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: critical
Priority: P2
Component: druntime
AssignedTo: nobody at puremagic.com
ReportedBy: code at klickverbot.at
--- Comment #0 from klickverbot <code at klickverbot.at> 2012-01-24 17:59:56 PST ---
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.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list