Search code examples
lazarusfreepascaldelphi

class property: Error: Illegal symbol for property access


I have this variable, function, property combination

ffieldIntegerPrivate:Integer;
function getFieldIntegerPrivate:Integer;
class property fieldIntegerPrivate:Integer read getFieldIntegerPrivate;

and in the implementation I have

function TMyClass.getFieldIntegerPrivate:Integer;
begin
    Result := ffieldIntegerPrivate;
end;

I get error: Error: Illegal symbol for property access

What could be the cause of this error?

Thanks in advance for your help.


Solution

  • Class property can only read class var.