July 25, 2016 typeid() on class instances discards immutable | ||||
---|---|---|---|---|
| ||||
I noticed that for some class `T`, `typeid(new immutable(T)) != typeid(immutable(T))`. The immutability is lost in the object's typeinfo, but retained in the class's typeinfo. See: https://dpaste.dzfl.pl/f04d41ff2986 Is this intended behaviour or a bug? I couldn't find any mention of it in the language docs. |
July 26, 2016 Re: typeid() on class instances discards immutable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Cauterite | On 25.07.2016 17:48, Cauterite wrote:
> I noticed that for some class `T`, `typeid(new immutable(T)) !=
> typeid(immutable(T))`. The immutability is lost in the object's
> typeinfo, but retained in the class's typeinfo.
>
> See: https://dpaste.dzfl.pl/f04d41ff2986
>
> Is this intended behaviour or a bug? I couldn't find any mention of it
> in the language docs.
Bug.
|
Copyright © 1999-2021 by the D Language Foundation