[fpc-devel] OR - IS operator precedence

Ondrej Pokorny lazarus at kluug.net
Wed May 15 23:27:54 CEST 2019


Why does FPC compile this? (Btw. regardless of mode.)

program Project1;
uses Classes;
var
   O1, O2: TObject;
   B: Boolean;
begin
   B := O1 is TPersistent or O2 is TPersistent;
end.

Delphi throws a compile error and according to FPC docs 
https://www.freepascal.org/docs-html/ref/refch12.html it should not 
compile in FPC either.

Ondrej




More information about the fpc-devel mailing list