Compiler skips incorrect expression. ( '=' with boolean typed property)
Original Reporter info from Mantis: skalogryyz
-
Reporter name: Dmitry Boyarintsev
Original Reporter info from Mantis: skalogryyz
- Reporter name: Dmitry Boyarintsev
Description:
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.Bool=False; // error: Illegal expression
b.Free;
end.
Mantis conversion info:
- Mantis ID: 15594
- Build: r14808
- Version: 2.5.1
- Fixed in version: 2.6.0
- Fixed in revision: 14998 (#88f5addd)
- Monitored by: » alexionne (Aleksa Todorovic)