[Issue 23291] Members of arrays of shared classes cannot be compared
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 12 05:18:17 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23291
--- Comment #4 from Boris Carvajal <boris2.9 at gmail.com> ---
(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.
--
More information about the Digitalmars-d-bugs
mailing list