typeid() on class instances discards immutable

Cauterite via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 25 08:48:06 PDT 2016


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.


More information about the Digitalmars-d mailing list