* 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:
Sven/Sarah Barth 2024-12-26 17:27:57 +01:00
parent 32b3477fe2
commit 79ff74ac44
3 changed files with 41 additions and 1 deletions

View File

@ -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
View 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
View 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.