Mercurial > projects > ldc
comparison runtime/internal/aaA.d @ 1512:09734fb929c0
Make == for associative arrays test for equality, not identity.
_aaEq was added to runtime/internal/aaA.d which forwards to
TypeInfo_AssociativeArray.equals in genobj.d. On the codegen side, DtoAAEquals
was added to gen/aa.cpp and is called from EqualExp::toElem in gen/toir.cpp.
I assume that the frontend will produce an error if == is used on associative
arrays of different type.
This fixes DMD bug 1429.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 21 Jun 2009 19:05:24 +0200 |
parents | f5f8c21ce6ef |
children |
comparison
equal
deleted
inserted
replaced
1511:5b66008246bb | 1512:09734fb929c0 |
---|---|
703 } | 703 } |
704 return result; | 704 return result; |
705 } | 705 } |
706 | 706 |
707 | 707 |
708 int _aaEq(AA aa, AA ab, TypeInfo_AssociativeArray ti) | |
709 { | |
710 return ti.equals(&aa, &ab); | |
711 } | |
712 | |
708 /*********************************** | 713 /*********************************** |
709 * Construct an associative array of type ti from | 714 * Construct an associative array of type ti from |
710 * length pairs of key/value pairs. | 715 * length pairs of key/value pairs. |
711 */ | 716 */ |
712 | 717 |