{$MODESWITCH PROPERTIES-} disables class properties not global properties
Original Reporter info from Mantis: Hixie
-
Reporter name: Ian Hickson
Original Reporter info from Mantis: Hixie
- Reporter name: Ian Hickson
Description:
According to the documentation (programmer's guide MODESWITCH section), {
MODESWITCH PROPERTIES} controls "global properties". However, it seems to control class-local properties, not global properties.
This compiles fine:
{$MODE OBJFPC} {$MODESWITCH PROPERTIES-}
program test;
function GetBar(): Cardinal; begin Result := 0; end;
property Bar: Cardinal read GetBar;
begin Writeln(Bar); end.
The following, though, has a "Syntax error, ":" expected but "identifier FOO" found":
{$MODE OBJFPC} {$MODESWITCH PROPERTIES-}
program test;
type
TTest = class
FFoo: Cardinal;
property Foo: Cardinal read FFoo;
end;
begin end.
Mantis conversion info:
- Mantis ID: 25861
- Build: trunk 2014/02/09
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 27758 (#362ff5ad)