27.10.2010 16:46, Birger Jansen wrote:

When swapping the rows with class var and FMyField it becomes this:

   TTest = class(TObject)
   private
     class var MyClassVar: Integer;
     FMyField: string;
   published
     property MyProperty: string read FMyField write FMyField;
   end;

This breaks the code, but on a strange line: the line property MyProperty (...) 
with Error: Illegal symbol for property access.

Compiler absolutely correctly reports you that MyProperty can't use FMyField field because it is a class field in this case, not an instance field.

The next code will work again:

    TTest = class(TObject)
    private
      class var
        MyClassVar: Integer;
      var
        FMyField: string;
    published
      property MyProperty: string read FMyField write FMyField;
    end;

Best regards,
Paul Ishenin.

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to