Răsfoiți Sursa

+ new test (not yet fixed)

git-svn-id: trunk@12050 -
Jonas Maebe 16 ani în urmă
părinte
comite
53213844d8
2 a modificat fișierele cu 37 adăugiri și 0 ștergeri
  1. 1 0
      .gitattributes
  2. 36 0
      tests/tbf/tb0214.pp

+ 1 - 0
.gitattributes

@@ -6579,6 +6579,7 @@ tests/tbf/tb0210.pp svneol=native#text/plain
 tests/tbf/tb0211.pp svneol=native#text/plain
 tests/tbf/tb0212.pp svneol=native#text/plain
 tests/tbf/tb0213.pp svneol=native#text/plain
+tests/tbf/tb0214.pp svneol=native#text/plain
 tests/tbf/ub0115.pp svneol=native#text/plain
 tests/tbf/ub0149.pp svneol=native#text/plain
 tests/tbf/ub0158a.pp svneol=native#text/plain

+ 36 - 0
tests/tbf/tb0214.pp

@@ -0,0 +1,36 @@
+{ %fail }
+
+{$ifdef fpc}
+{$mode delphi}
+{$endif}
+
+type
+  tc = class
+   private
+    fo: tobject;
+    function getfo(i: integer): tobject;
+    procedure putfo(i: integer; o: tobject);
+   public
+    property o[i:integer]: tobject read getfo write putfo; default;
+  end;
+
+function tc.getfo(i:integer): tobject;
+begin
+  result:=fo;
+end;
+
+procedure tc.putfo(i: integer; o: tobject);
+begin
+  fo:=o;
+end;
+
+var
+  c: tc;
+begin
+  c:=tc.create;
+  { should give an error stating that you cannot assign to left hand side }
+  { (generated code also does not result in an assignment)                }
+  tc(c[5]):=tc(5);
+  writeln(longint(c[5]));
+end.
+