"David Piepgrass" , dans le message (digitalmars.D:172007), a écrit :@mutating class B : A { private int _x2; public @property override x() { return _x2++; } }A fun() pure; You can't cast the result of fun to immutable, because it may be a B instance.
Yes. To complete the point, since you have no idea what has derived from A, it can never be done for non-final objects.
-Steve