var b: boolean; o: TObject; begin // this compiles, but should fail: if o is TComponent and b then ;
It will compile if $BOOLEVAL is on the default (-) because the result can be determined without considering precedence, see:
https://www.freepascal.org/docs-html/prog/progsu4.html Try it the other way round and it will fail: o: TComponent; if o is TObject Martin. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal