Browse Source

* new bug

peter 23 years ago
parent
commit
955ca62d6a
1 changed files with 40 additions and 0 deletions
  1. 40 0
      tests/webtbf/tw1782.pp

+ 40 - 0
tests/webtbf/tw1782.pp

@@ -0,0 +1,40 @@
+{ %fail }
+
+{ Source provided for Free Pascal Bug Report 1782 }
+{ Submitted by "Aleksey V. Vaneev" on  2002-01-27 }
+{ e-mail: [email protected] }
+
+{$mode objfpc}
+
+type
+        PStruct = ^TStruct;
+        TStruct =
+                packed record
+                        i: LongInt;
+                end;
+
+        TCls = class
+                protected
+                        Fv: array [1..10] of TStruct;
+
+                        function getv (i: LongInt): TStruct;
+
+                public
+                        property v [i: LongInt]: TStruct read getv;
+                end;
+
+function TCls.getv (i: LongInt): TStruct;
+begin
+        Result := Fv [i];
+end;
+
+var
+        sp: PStruct;
+        o: TCls;
+
+begin
+        o := TCls.create;
+        { Should fail with 'variable expected' }
+        sp := @o.v [10];
+end.
+