property/opAddAssign problem

Steven Schveighoffer schveiguy at yahoo.com
Tue Dec 29 13:33:47 PST 2009


On Tue, 29 Dec 2009 13:44:18 -0500, teo <teo.ubuntu.remove at yahoo.com>  
wrote:

> On Tue, 29 Dec 2009 09:12:15 -0500, Steven Schveighoffer wrote:
>>
>> Eventually, marking Prop as a @property should also work (haven't tested
>> it, it may work now):
>>
>> @property A Prop() { return a; }
>>
>> ...
>>
>> b.Prop += 3; // compiles
>>
>> -Steve
>
> Unfortunately it doesn't:
>
> test.d(17): Error: 'b.Prop' is not a scalar, it is a @property A()
> test.d(17): Error: incompatible types for ((b.Prop) += (3)): '@property A
> ()' and 'int'
>

It will evenutally, probably within the next couple releases.

-Steve


More information about the Digitalmars-d-learn mailing list