* do not warn on anonymous functions without captured variables about being not used, resolves #39853

This commit is contained in:
florian 2022-07-29 21:46:07 +02:00
parent c122e16beb
commit 6c47f8f4d7
2 changed files with 10 additions and 0 deletions

View File

@ -1127,6 +1127,8 @@ implementation
aprocsym:=cprocsym.create('$'+lower(sp))
else
aprocsym:=cprocsym.create(orgsp);
if ppf_anonymous in flags then
include(aprocsym.symoptions,sp_internal);
if addgendummy then
include(aprocsym.symoptions,sp_generic_dummy);
symtablestack.top.insertsym(aprocsym);

8
tests/webtbs/tw39853.pp Normal file
View File

@ -0,0 +1,8 @@
{ %opt=-vh -Sewh }
{$modeswitch anonymousfunctions}
var
p: procedure(const s: string);
begin
p := procedure(const s: string) begin writeln(s); end;
p('test');
end.