mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 10:48:30 +02:00

* 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 -
43 lines
590 B
ObjectPascal
43 lines
590 B
ObjectPascal
{ %fail }
|
|
{ %norun }
|
|
|
|
{$ifdef fpc}
|
|
{$mode objfpc}
|
|
{$endif}
|
|
|
|
type
|
|
TTest = class
|
|
private
|
|
FTest: Integer;
|
|
procedure SetTest(const Value: Integer);
|
|
public
|
|
property Test: Integer read FTest write SetTest;
|
|
end;
|
|
|
|
{ TTest }
|
|
|
|
procedure TTest.SetTest(const Value: Integer);
|
|
begin
|
|
// Writeln('SetTest called!');
|
|
// FTest := Value;
|
|
end;
|
|
|
|
var
|
|
Test: TTest;
|
|
f: text;
|
|
|
|
begin
|
|
|
|
Test := TTest.Create;
|
|
{
|
|
Writeln('Test.Test = ', Test.Test);
|
|
Test.Test := 2;
|
|
Writeln('Test.Test = ', Test.Test);
|
|
}
|
|
ReadLn(f,Test.Test);
|
|
// Writeln('Test.Test = ', Test.Test);
|
|
|
|
// ReadLn;
|
|
end.
|
|
|