[fpc-pascal] Default record const values

Sven Barth pascaldragon at googlemail.com
Sat Nov 10 14:21:16 CET 2018

Am Sa., 10. Nov. 2018, 12:44 hat Ryan Joseph <ryan at thealchemistguild.com>

> Not quite understanding how that’s not entirely parsed by the time you
> assign outside of the record. Even so I would expect it to copy what the
> const was able to capture, fully parsed or not.

It's not entirely parsed by the time the constant is declared. That is
simply illegal code.

> Also, why does it work to do
> begin
>   r := TMyRecord.default;
> in the main block?

It's not possible to use typed constants as initializers for variables.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20181110/3054d013/attachment.html>

More information about the fpc-pascal mailing list