Congratulations to the D Team!

Steven Schveighoffer schveiguy at yahoo.com
Thu Jul 12 06:17:57 PDT 2012


On Thu, 12 Jul 2012 03:18:51 -0400, Christophe Travert  
<travert at phare.normalesup.org> wrote:

> "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


More information about the Digitalmars-d mailing list