Am 11.09.2022 um 14:22 schrieb Sven Barth via fpc-pascal:
Ondrej Pokorny via fpc-pascal <fpc-pascal@lists.freepascal.org>
schrieb am So., 11. Sep. 2022, 12:18:
Shouldn't this assignment be forbidden?
type
TProc = procedure is nested;
function TestNested: TProc;
begin
result := procedure // why is this possible?
begin
writeln(data);
end;
It is not a nested function but an anonymous one.
And? An anonymous function is assignment compatible to multiple left
sides depending on what it captures. See my announcement mail.
Thank you Sven - I missed this info in your email.
Ondrej
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal