[fpc-pascal] Record helper properties

Ryan Joseph ryan at thealchemistguild.com
Tue Apr 23 21:54:13 CEST 2019


So I remember now that any fields are not allowed in helpers. Can anyone explain why this must be the case or if it could be fixed?

> On Apr 20, 2019, at 11:24 AM, Ryan Joseph <ryan at thealchemistguild.com> wrote:
> 
> I feel like I may have asked this before but I can’t find anything on Google. Why doesn’t this work?
> 
> program test;
> 
> type
> 	TRec = record
> 		x: integer;
> 	end;
> 
> type
> 	THelper = record helper for TRec
> 		property F: integer read x; // <<<—— ERROR: Unknown class field or method identifier "x"
> 	end;
> 
> begin
> end.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list