blob: e36aef429201a05f50c1540280ac42d5e6068c56 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
{ %fail }
{ Source provided for Free Pascal Bug Report 1782 }
{ Submitted by "Aleksey V. Vaneev" on 2002-01-27 }
{ e-mail: picoder@sbis.komi.ru }
{$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.
|