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

Sven Barth pascaldragon at googlemail.com
Sun Feb 5 09:27:42 CET 2017


Am 05.02.2017 09:13 schrieb "Ryan Joseph" <ryan at thealchemistguild.com>:
>
> Why is this restriction in place and what are the alternatives if any?
Some times I want to just provide a method that sets default values for a
record without any parameters but FPC doesn’t let me for some reason.

Delphi compatibility.
As a workaround you could add a constructor with a default parameter.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170205/01ce38d1/attachment.html>


More information about the fpc-pascal mailing list