mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 08:59:26 +02:00
* fix #41007: only unlink typesyms from their typedefs when releasing an unused implicit specialization if the typesym was created for the implicit specialization
+ added test
This commit is contained in:
parent
32b3477fe2
commit
79ff74ac44
@ -1335,7 +1335,7 @@ uses
|
||||
begin
|
||||
for k:=0 to callerparams.count-1 do
|
||||
begin
|
||||
if tsym(callerparams[k]).typ=typesym then
|
||||
if (tsym(callerparams[k]).typ=typesym) and (sp_generic_unnamed_type in ttypesym(callerparams[k]).symoptions) then
|
||||
ttypesym(callerparams[k]).typedef.typesym:=nil;
|
||||
end;
|
||||
end;
|
||||
|
23
tests/webtbs/tw41007.pp
Normal file
23
tests/webtbs/tw41007.pp
Normal file
@ -0,0 +1,23 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tw41007;
|
||||
|
||||
{$mode delphi}
|
||||
{$modeswitch implicitfunctionspecialization}
|
||||
|
||||
uses
|
||||
uw41007;
|
||||
|
||||
procedure Test(A: string; B: string); overload;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure Test<T>; overload;
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
begin
|
||||
Test('aa', 'bb');
|
||||
end.
|
||||
|
17
tests/webtbs/uw41007.pp
Normal file
17
tests/webtbs/uw41007.pp
Normal file
@ -0,0 +1,17 @@
|
||||
unit uw41007;
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
interface
|
||||
|
||||
procedure Test<T>(A: T); overload;
|
||||
|
||||
implementation
|
||||
|
||||
procedure Test<T>(A: T);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user