michael 27 年之前
父节点
当前提交
131e87ba6f
共有 2 个文件被更改,包括 47 次插入1 次删除
  1. 45 0
      bugs/bug0137.pp
  2. 2 1
      bugs/readme.txt

+ 45 - 0
bugs/bug0137.pp

@@ -0,0 +1,45 @@
+program OO_Test;
+
+Type TVater = Object
+                Constructor Init;
+                Procedure Gehen; Virtual;
+                Procedure Laufen; Virtual;
+              End;
+
+     TSohn = Object(TVater)
+               Procedure Gehen; Virtual;
+             End;
+
+Var V : TVater;
+    S : TSohn;
+
+Constructor TVater.Init;
+Begin
+End;
+
+Procedure TVater.Gehen;
+Begin
+  Writeln('langsam gehen');
+End;
+
+Procedure TVater.Laufen;
+Begin
+  Gehen;
+  Gehen;
+End;
+
+Procedure TSohn.Gehen;
+Begin
+  Writeln('schnell gehen');
+End;
+
+Begin
+  V.Init;
+  S.Init;
+  V.Laufen;
+  Writeln;
+  S.Laufen;
+  Writeln;
+  V := S; 
+  V.Gehen;
+End.

+ 2 - 1
bugs/readme.txt

@@ -182,4 +182,5 @@ bug0131.pp   internal error 10 with highdimension arrays
 bug0132.pp   segmentation fault with type loop
 bug0132.pp   segmentation fault with type loop
 bug0133.pp   object type declaration not 100% compatibile with TP7
 bug0133.pp   object type declaration not 100% compatibile with TP7
 bug0135.pp   Unsupported subrange type construction.
 bug0135.pp   Unsupported subrange type construction.
-bug0136.pp   No types necessary in the procedure header
+bug0136.pp   No types necessary in the procedure header
+bug0137.pp   Cannot assign child object variable to parent objcet type variable