fpc/tests/webtbs/tw8777i.pp
Jonas Maebe de1af478c3 * do not allow passing properties as var parameters (mantis #8777)
* do not allow assignments to fields of structured properties (e.g.
    property prop: trec read frec; ... instance.prop.frec.a:=5) 
  * clarified some related error messages
  + several extra tests for the above and related things

git-svn-id: trunk@7250 -
2007-05-03 14:08:03 +00:00

26 lines
342 B
ObjectPascal

{ %norun }
{$ifdef fpc}
{$mode delphi}
{$endif}
type
tc = class
private
f: array[0..5] of integer;
procedure setf(const val: integer);
public
property prop: integer read f[1] write setf;
end;
procedure tc.setf(const val: integer);
begin
f[1]:=val;
end;
var
c: tc;
p: pointer;
begin
p := @c.prop;
end.