On Sat, 7 Mar 2026, Martin Frb via fpc-devel wrote:

https://gitlab.com/freepascal.org/fpc/source/-/work_items/41642#note_3135425124
That's actually a FPC compiler bug:
procedure WriteProperty(Path: String; Instance: TObject;
PropInfo: Pointer; DefInstance: TObject = nil;
const OnlyProperty: array of String);


then what is the correct syntax?

The link suggests there needs to be a default value for OnlyProperty (and I would have expected that too).

But FPC does reject *any* default. It reject the = sign itself, if any is added.

So what is the correct syntax?

As I wrote in the ticket you refer to, it's a bug in FPC, which is
formalized in this ticket:

https://gitlab.com/freepascal.org/fpc/source/-/work_items/41644

I would expect - when the bug is corrected - that the syntax is "= Nil"

For the time being, I suggest you use an overload.

Michael.
_______________________________________________
fpc-devel maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to