mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 05:59:28 +02:00
* inserting $result into the symtables should never trigger a duplicate symbol error, resolves #40608
This commit is contained in:
parent
272417e602
commit
b32573d1eb
@ -351,7 +351,7 @@ implementation
|
||||
not paramanager.ret_in_param(pd.returndef,pd) then
|
||||
begin
|
||||
vs:=clocalvarsym.create('$result',vs_value,pd.returndef,[vo_is_funcret]);
|
||||
pd.localst.insertsym(vs);
|
||||
pd.localst.insertsym(vs,false);
|
||||
pd.funcretsym:=vs;
|
||||
end;
|
||||
|
||||
|
13
tests/webtbs/tw40608.pp
Normal file
13
tests/webtbs/tw40608.pp
Normal file
@ -0,0 +1,13 @@
|
||||
{$mode ObjFPC}{$H+}
|
||||
|
||||
generic function genericfunc<T>: String;
|
||||
|
||||
function innerfunc: String;
|
||||
begin // project1.lpr(6,3) Error: Duplicate identifier "$result"
|
||||
end;
|
||||
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user