[fpc-devel] Class property and virtual getter

Sven Barth pascaldragon at googlemail.com
Thu Feb 27 09:25:10 CET 2014


Am 27.02.2014 04:36, schrieb luiz americo pereira camara:
> TSimpleModel = class(TPersistent)
>   protected
>     class function GetResourceClient: IResourceClient; virtual;
>     class property ResourceClient: IResourceClient read GetResourceClient;
>   public
>   end;
>
> Trying to compile the above code i get the following error:
> Error: Illegal symbol for property access
>
> Changing the GetResourceClient method from virtual to static works
>
> Is this a bug or by design?
As Michael said this is by design. If you want to use a non-static class 
procedure you must not use "class property", but only "property" (yes, 
that works).

Regards,
Sven



More information about the fpc-devel mailing list