2
0
Эх сурвалжийг харах

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

Sven/Sarah Barth 3 жил өмнө
parent
commit
4053d59a2c

+ 1 - 2
compiler/ptype.pas

@@ -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 - 0
tests/webtbs/tw39673.pp

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