Browse Source

bug0198 solved

pierre 26 years ago
parent
commit
cbad5f2934
2 changed files with 25 additions and 3 deletions
  1. 23 1
      bugs/bug0198.pp
  2. 2 2
      bugs/readme.txt

+ 23 - 1
bugs/bug0198.pp

@@ -1,9 +1,31 @@
+{$mode fpcobj}
+
 type
-   to1 = class
+   to1 = class (tobject)
+       x : longint;
+       constructor init;
        function GetCaps1 : Longint;virtual;abstract;
        function GetCaps2 : Longint;virtual;stdcall;
        function GetCaps : Longint;virtual;stdcall;abstract;
+       destructor done;virtual; 
    end;
+ 
+   constructor to1.init;
+    begin
+      x:=5;
+    end;
+
+   function to1.GetCaps2 : longint;
+    begin
+      GetCaps2:=x;
+    end;
+ 
+   destructor to1.done;
+    begin
+    end;
 
+var o1 : to1;
 begin
+  o1:=to1.create;
+  if o1.getCaps2<>5 then halt(1);
 end.

+ 2 - 2
bugs/readme.txt

@@ -240,6 +240,8 @@ Fixed bugs:
   bug0196.pp   "function a;" is accepted (should require result type) OK 0.99.1 (PM)
   bug0197.pp   should produce an error: problem with c1:=c2<c3 where c? is OK 0.99.11 (PM)
                a comp type
+  bug0198.pp   calling specifications aren't allowed in class declarations,
+               this should be allowed                                OK 0.99.11  (PM)
   bug0199.pp   bug in mul code                                       OK 0.99.11  (FK)
   bug0200.pp   array of char overloading problem with strings        OK 0.99.11 (PFV)
   bug0201.pp   problem with record var-parameters and assembler      OK 0.99.11 (PFV)
@@ -302,8 +304,6 @@ bug0226.pp   Asm, offset of var is not allowed as constant
 bug0228.pp   Asm, wrong warning for size
 
 bug0185.pp   missing range checking for Val and subrange types
-bug0198.pp   calling specifications aren't allowed in class declarations,
-             this should be allowed
 bug0212.pp   problem with properties
 bug0217.pp   in tp mode can't use the procvar in writeln
 bug0221.pp   syntax parsing incompatibilities with tp7