فهرست منبع

* delay setting of pd_body and pd_implement till the header of a generic
procedure is parsed, resolves #37261

git-svn-id: trunk@45717 -

florian 5 سال پیش
والد
کامیت
ff295bf349
3فایلهای تغییر یافته به همراه24 افزوده شده و 1 حذف شده
  1. 1 0
      .gitattributes
  2. 2 1
      compiler/pgenutil.pas
  3. 21 0
      tests/webtbs/tw37261.pp

+ 1 - 0
.gitattributes

@@ -18346,6 +18346,7 @@ tests/webtbs/tw3721.pp svneol=native#text/plain
 tests/webtbs/tw37218.pp svneol=native#text/pascal
 tests/webtbs/tw37228.pp svneol=native#text/plain
 tests/webtbs/tw37254.pp svneol=native#text/pascal
+tests/webtbs/tw37261.pp svneol=native#text/pascal
 tests/webtbs/tw37272a.pp svneol=native#text/pascal
 tests/webtbs/tw3742.pp svneol=native#text/plain
 tests/webtbs/tw3751.pp svneol=native#text/plain

+ 2 - 1
compiler/pgenutil.pas

@@ -1247,7 +1247,7 @@ uses
                     end;
                   procdef:
                     begin
-                      pdflags:=[pd_body,pd_implemen];
+                      pdflags:=[];
                       if genericdef.owner.symtabletype=objectsymtable then
                         include(pdflags,pd_object)
                       else if genericdef.owner.symtabletype=recordsymtable then
@@ -1259,6 +1259,7 @@ uses
                         handle_calling_convention(tprocdef(result),hcc_default_actions_intf)
                       else
                         handle_calling_convention(tprocdef(result),hcc_default_actions_impl);
+                      pdflags:=pdflags+[pd_body,pd_implemen];
                       proc_add_definition(tprocdef(result));
                       { for partial specializations we implicitely declare the routine as
                         having its implementation although we'll not specialize it in reality }

+ 21 - 0
tests/webtbs/tw37261.pp

@@ -0,0 +1,21 @@
+program Project1;
+
+{$mode delphi}
+
+type
+
+  { TClass }
+
+  TClass = class
+  public
+    class function ToString<T>(A: T; B: string): string; reintroduce;
+  end;
+
+{ TClass }
+
+class function TClass.ToString<T>(A: T; B: string): string;
+begin end;
+
+begin
+  TClass.ToString<integer>(1, '');
+end.