* fix #39673: also resolve the dummy symbol in case this isn't a reuse of the current generic's name

+ added test
This commit is contained in:
Sven/Sarah Barth 2022-04-21 21:04:25 +02:00
parent 98a942a37e
commit 4053d59a2c
2 changed files with 31 additions and 2 deletions

View File

@ -644,8 +644,7 @@ implementation
end
else
begin
Message(parser_e_no_generics_as_types);
def:=generrordef;
def:=handle_dummysym(srsym);
end;
end
else if is_classhelper(def) and

30
tests/webtbs/tw39673.pp Normal file
View File

@ -0,0 +1,30 @@
{ %NORUN }
program tw39673;
{$ifdef fpc}
{$mode delphi}
{$else}
{$APPTYPE CONSOLE}
{$endif}
uses
Types,
Classes,
contnrs,
generics.collections;
Type tsomeclass =class
function readarray:TObjectList;
end;
{ tsomeclass }
function tsomeclass.readarray: TObjectList;
begin
result:=nil;
end;
begin
end.