Let’s consider this code:
type TMyClass = class private FStrings: List<string>; public method Lock; empty; method Unlock; empty; function GetString(AIndex: Integer): string; inline; begin Lock; try Result := FStrings[AIndex]; finally Unlock; end; end; end;
Under Delphi, the inline keyword is quite happily used but with Oxygene, I get an error message at the very end of the compilation telling me that
FStrings is private and thus
GetString cannot be inlined.
Why is there such a limit here?