[Issue 23291] Members of arrays of shared classes cannot be compared
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Aug 11 16:36:54 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23291
--- Comment #3 from Ruby The Roobster <rubytheroobster at yandex.com> ---
(In reply to Boris Carvajal from comment #2)
> Same as issue 23140, it never worked!
>
This code actually did work as intended, 23140, unless you mean something else
which I don't understand.
> ```d
> const(shared C) c = new shared C();
> const(shared C)[] a = [c];
> const(shared C)[] b = [c];
> assert(a[0] == b[0]);
> ```
>
> Also, you should put `override` in `opEquals` definition:
>
> `override bool opEquals(const(shared(Object)) rhs) const shared`
>
> Now the real problem is more clear, there is no shared compatible `opEquals`
> in D runtime so you can't even override it with your own implementation.
>
> A quick search shows it's already reported in issues 4857, 9670, 14509.
> Sad that one of them is 12 years old.
That's another issue that I also noticed.
--
More information about the Digitalmars-d-bugs
mailing list