Comment #0 by bearophile_hugs — 2014-07-14T10:23:10Z
void main() {
uint[] a = [1, 2];
byte[] b = [1, 2];
auto r1 = a == b; // OK
uint[int] aa1 = [10: 20];
byte[int] aa2 = [10: 20];
auto r2 = aa1 == aa2; // Error
}
DMD 2.066beta3 gives:
temp.d(7,15): Error: incompatible types for ((aa1) == (aa2)): 'uint[int]' and 'byte[int]'
Comment #1 by hsteoh — 2014-07-15T15:17:26Z
This doesn't look likely to be fixable until AA's are fully implemented as a library type. The problem is that the current implementation is keyed on TypeInfo's, and given two arbitrary TypeInfo's it's not obvious how to determine whether the underlying types are implicitly convertible to each other. Maybe there's some obvious way that I missed, but as of now, I don't see this fixed anytime in the near future. :-(
Comment #2 by bearophile_hugs — 2014-07-15T16:42:50Z
(In reply to hsteoh from comment #1)
> I don't see this fixed anytime in the near future. :-(
This is a low-priority enhancement request.
Comment #3 by hsteoh — 2014-07-15T16:47:50Z
I know, I'm just saying, don't expect it to be fixed anytime soon. It's a bit sad for me, esp. since the last time I tried to implement a library AA, this is already supported. :-/
Comment #4 by robert.schadek — 2024-12-13T18:22:10Z