Am 19.06.2013 13:40, schrieb Iain Buclaw:
On Wednesday, 19 June 2013 at 11:33:43 UTC, deed wrote:
The following compiles and crashes with DMD 2.063.
Should this be a compile time error?


class A
{
    int _var;


/* SNIP */

    int var() @property
    {
        return var;
    }

Isn't the problem in this property function?  (Shouldn't it
return _var :o)

that isn't the problem - D allows assignment to an read property - and there is no write property around, so it should be an compiletime error

i should compile only if the missing write property is available - or?

@property int var(int value) { return _var = value; }

Reply via email to