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

Ryan Joseph ryan at thealchemistguild.com
Sun Feb 5 14:34:07 CET 2017


I never knew Pascal had default parameters, a feature I always use and enjoy in PHP. Once again I learn something new about the language I use. :)

However, the constructor with default params does not work. I get the same error as before. {$modeswitch advancedrecords} is on.

type
	MyRecord = record
		x: integer;
		constructor Foo (_x: integer = 0);
	end;


> On Feb 5, 2017, at 8:29 PM, Sven Barth <pascaldragon at googlemail.com> wrote:
> 
> See here at the bottom: http://freepascal.org/docs-html/current/ref/refsu65.html#x176-19800014.4.1 (it's the same for any kind of routine: function, procedure, method, constructor...)

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list