DIP23 draft: Fixing properties redux

TommiT tommitissari at hotmail.com
Sun Feb 3 08:01:59 PST 2013


On Sunday, 3 February 2013 at 15:48:00 UTC, Johannes Pfau wrote:
>> -----------
>> In order to use the assignment operator "=" property-style, the
>> @property annotation MUST be used.
>> -----------
>
> There's a example on the page though which contradicts this:
>
> static int x;
> ref int fun1() { return x; }
> fun1 = 42;

That example has nothing to do with properties. It's just:

static int x;
ref int fun1() { return x; }
fun1() = 42;

...except that the empty parens were omitted (which is allowed 
there).


More information about the Digitalmars-d mailing list