Browse Source

+ bug0307

Jonas Maebe 25 years ago
parent
commit
41557bcd50
2 changed files with 32 additions and 0 deletions
  1. 31 0
      bugs/bug0307.pp
  2. 1 0
      bugs/readme.txt

+ 31 - 0
bugs/bug0307.pp

@@ -0,0 +1,31 @@
+type
+  tobj = object
+    l: longint;
+    constructor init;
+    procedure setV(v: longint);
+    destructor done;
+  end;
+
+constructor tobj.init;
+begin
+  l := 0;
+end;
+
+procedure tobj.setV(v: longint);
+begin
+  l := v;
+end;
+
+destructor tobj.done;
+begin
+end;
+
+var t: tobj;
+
+begin
+  t.init;
+  with t do
+    setV(5);
+  writeln(t.l, ' (should be 5!)');
+  t.done;
+end.

+ 1 - 0
bugs/readme.txt

@@ -396,3 +396,4 @@ bug0262.pp   problems with virtual and overloaded methods
 bug0293.pp   no error with variable name = type name
 bug0299.pp   passing Array[0..1] of char by value to proc leads to problems
 bug0305.pp   Finally is not handled correctly after inputting 0
+bug0307.pp   "with object_type" doesn't work correctly!