mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 08:18:12 +02:00

because the associated simplifications can turn invalid statements into valid statements (based on patch by Aleksa Todorovic, mantis #15594) git-svn-id: trunk@14998 -
45 lines
683 B
ObjectPascal
45 lines
683 B
ObjectPascal
{ %fail }
|
|
|
|
program project1;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
type
|
|
|
|
{ TBoolObject }
|
|
|
|
TBoolObject = class(TObject)
|
|
private
|
|
fBool: Boolean;
|
|
procedure SetBool(const AValue: Boolean);
|
|
|
|
protected
|
|
function GetBool: Boolean;
|
|
property Bool: Boolean read GetBool write SetBool default True;
|
|
end;
|
|
|
|
TSubBoolObject = class(TBoolObject)
|
|
published
|
|
property Bool default True;
|
|
end;
|
|
|
|
{ TBoolObject }
|
|
|
|
procedure TBoolObject.SetBool(const AValue: Boolean);
|
|
begin
|
|
fBool:=AValue;
|
|
end;
|
|
|
|
function TBoolObject.GetBool: Boolean;
|
|
begin
|
|
Result:=fBool;
|
|
end;
|
|
|
|
var
|
|
b: TSubBoolObject;
|
|
begin
|
|
b:=TSubBoolObject.Create;
|
|
b.Bool=True; // NO ERROR!!! why?????
|
|
b.Free;
|
|
end.
|