Browse Source

* more static method bugs

pierre 26 years ago
parent
commit
c6657c9ba2
2 changed files with 40 additions and 1 deletions
  1. 38 0
      bugs/bug0215.pp
  2. 2 1
      bugs/readme.txt

+ 38 - 0
bugs/bug0215.pp

@@ -0,0 +1,38 @@
+{ $OPT=-St }
+{ allow static keyword }
+{ submitted by Andrew Wilson }
+
+Program X;
+
+Type
+   PY=^Y;
+   Y=Object
+      A : LongInt;
+      P : PY; static;
+      Constructor Init(NewA:LongInt);
+      Procedure StaticMethod; static;
+      Procedure VirtualMethod; virtual;
+   End;
+
+Constructor Y.Init(NewA:LongInt);
+   Begin
+      A:=NewA;
+      P:=@self;
+   End;
+Procedure Y.StaticMethod;
+   Begin
+      Writeln(P^.A);    // Compiler complains about using A.
+      P^.VirtualMethod; // Same with the virtual method.
+      With P^ do begin
+         Writeln(A);    // These two seem to compile, but I
+         VirtualMethod; // can't get them to work. It seems to
+      End;              // be the same problem as last time, so
+   End;                 // I'll check it again when I get the
+                        // new snapshot.
+Procedure Y.VirtualMethod;
+   Begin
+      Writeln('VirtualMethod');
+   End;
+
+Begin
+End.

+ 2 - 1
bugs/readme.txt

@@ -250,6 +250,7 @@ Fixed bugs:
                (problem created while solving bug205 ! PM)          OK 0.99.11 (PM)
                (problem created while solving bug205 ! PM)          OK 0.99.11 (PM)
   bug0210.pp   fillchar should accept boolean value also !!         OK 0.99.11 (PM)
   bug0210.pp   fillchar should accept boolean value also !!         OK 0.99.11 (PM)
   bug0211.pp   a and not a is true !!! (if a:=boolean(5))           OK 0.99.11 (PM)
   bug0211.pp   a and not a is true !!! (if a:=boolean(5))           OK 0.99.11 (PM)
+  bug0214.pp   bug for static methods                               OK 0.99.11 (PM)
 
 
 Unproducable bugs:
 Unproducable bugs:
 ------------------
 ------------------
@@ -287,4 +288,4 @@ bug0206.pp   sets with variable ranges doesn't work
 bug0212.pp   problem with properties
 bug0212.pp   problem with properties
 bug0213.pp   name mangling problem with nested procedures in overloaded
 bug0213.pp   name mangling problem with nested procedures in overloaded
              procedure
              procedure
-bug0214.pp   bug for static methods
+bug0215.pp   more bugs with static methods