[fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

Ryan Joseph ryan at thealchemistguild.com
Mon Feb 6 02:06:21 CET 2017


I tried class functions in records already but I got the error "Class methods must be static in records”. Not sure what that means but I assumed they don’t work either.

Too bad, that would be a nice feature.

> On Feb 6, 2017, at 2:29 AM, Sven Barth <pascaldragon at googlemail.com> wrote:
> 
> Oh, well, it was worth a shot... Alternatively you could declare a class function named Create that returns an instance of the record. Even Delphi is using that for Rtti.TRttiContext.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list