mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 06:29:32 +02:00
* do not warn on anonymous functions without captured variables about being not used, resolves #39853
This commit is contained in:
parent
c122e16beb
commit
6c47f8f4d7
@ -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
8
tests/webtbs/tw39853.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user