[fpc-devel] [] property overloads

Ryan Joseph genericptr at gmail.com
Tue Jul 9 15:39:20 CEST 2019


Another thing regarding array properties. If I use constref on the setter I get an error "Illegal symbol for property access”. Is there any reason why the setter can’t be constref? If not I’d like to change this with my array properties patch. Making it inline properly avoids the copy but you may not want inline and just want to avoid the copy during setting.

     function GetValue(index: integer): T; inline;
     procedure SetValue(index: integer; constref value: T); inline; // “T” is a record so we want constref here
     property PrivateValues[index: integer]: T read GetValue write SetValue; default; // ERROR: Illegal symbol for property access

Regards,
	Ryan Joseph



More information about the fpc-devel mailing list