Should it be a compile time error?

deed none at none.none
Wed Jun 19 04:33:41 PDT 2013


The following compiles and crashes with DMD 2.063.
Should this be a compile time error?


class A
{
     int _var;

     void var(int i) @property
     {
         this.var = i;   // oops, crashes.
     }                   // should have been this._var

     int var() @property
     {
         return var;
     }
}

void main()
{
     auto a = new A();
     a.var = 3;
}


More information about the Digitalmars-d-learn mailing list