@property needed or not needed?

sclytrack sclytrack at thailand.warm
Mon Dec 3 04:47:36 PST 2012


> int func() { return 1; }
> void func(int n) { }
> @property int prop() { return 2; }
> @property void prop(int n) { }
> void main() {
>   // Without -property switch, all lines can compile.
>   // With -property switch:
>   func();     // OK -> OK
>   func(1);    // OK -> OK
>   func;       // OK -> OK [*]
>   func = 1;   // OK -> NG (fixed!)
>   prop();     // OK -> NG (fixed!)
>   prop(1);    // OK -> NG (fixed!)
>   prop;       // OK -> OK
>   prop = 1;   // OK -> OK
> }
>
DIP21: Fixing @property

Nice but DIP21 does not discuss dynamic D.




More information about the Digitalmars-d mailing list