[Issue 23291] Members of arrays of shared classes cannot be compared
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Aug 13 14:37:35 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23291
--- Comment #6 from Ruby The Roobster <rubytheroobster at yandex.com> ---
(In reply to Boris Carvajal from comment #4)
> (In reply to Ruby The Roobster from comment #3)
> > (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.
>
> Because type modifiers in class definitions were not applied before due to a
> bug, structs were though.
>
> ```d
> shared class C {}
> const(C) c = new C(); // this should be 'shared' implicitly
> pragma(msg, typeof(c)); // now it's 'shared(const(C))' but before it was
> only 'const(C)'
>
> ```
> So the code worked because 'shared' was discarded.
Ah. I forgot about that. So it turns out that this bug is far older than I
imagined.
--
More information about the Digitalmars-d-bugs
mailing list