Browse Source

* allow reintroduce for objects, resolves #14743

git-svn-id: trunk@13832 -
florian 16 years ago
parent
commit
b8a83fd997
3 changed files with 24 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/pdecsub.pas
  3. 22 0
      tests/webtbs/tw14743.pp

+ 1 - 0
.gitattributes

@@ -9320,6 +9320,7 @@ tests/webtbs/tw14617.pp svneol=native#text/plain
 tests/webtbs/tw1470.pp svneol=native#text/plain
 tests/webtbs/tw1472.pp svneol=native#text/plain
 tests/webtbs/tw14740.pp svneol=native#text/plain
+tests/webtbs/tw14743.pp svneol=native#text/pascal
 tests/webtbs/tw1477.pp svneol=native#text/plain
 tests/webtbs/tw1479.pp svneol=native#text/plain
 tests/webtbs/tw1485.pp svneol=native#text/plain

+ 1 - 1
compiler/pdecsub.pas

@@ -1376,7 +1376,7 @@ procedure pd_reintroduce(pd:tabstractprocdef);
 begin
   if pd.typ<>procdef then
     internalerror(200401211);
-  if not(is_class_or_interface(tprocdef(pd)._class)) then
+  if not(is_class_or_interface_or_object(tprocdef(pd)._class)) then
     Message(parser_e_no_object_reintroduce);
 end;
 

+ 22 - 0
tests/webtbs/tw14743.pp

@@ -0,0 +1,22 @@
+{$mode delphi}
+program tbreintroduce;
+
+type
+    parent = object
+        constructor init;
+    end;
+
+    child = object(parent)
+        constructor init(a : byte);reintroduce;
+    end;
+
+constructor parent.init;
+begin
+end;
+
+constructor child.init(a : byte);
+begin
+end;
+
+begin
+end.