[fpc-pascal] strict private construct

Sven Barth pascaldragon at googlemail.com
Fri Apr 12 14:34:53 CEST 2019


Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> schrieb am Fr., 12. Apr.
2019, 14:20:

> On 12/04/2019 13:10, Graeme Geldenhuys wrote:
> > On 12/04/2019 12:40, Mattias Gaertner via fpc-pascal wrote:
> >> I get:
> >> test1.pas(26,8) Error: identifier idents no member "FDropDown"
> >
> > It works in Delphi 10.2.3
>
>
> Ah wait, the code comment was wrong. Those fields were actually "strict
> protected", not "strict private".
>
> Delphi gives a compilation error "E2361 Cannoct access private symbol
> ...."  for strict private fields, but I can access strict protected fields.
>
> Still not sure if that is any better though. Seems to defeat the whole
> point of "strict xxx" construct.
>

For (strict) protected it's by design as a class helper is so to speak
inheriting from the extended class (it's not 1:1 the same, but close
enough).

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190412/d301919a/attachment.html>


More information about the fpc-pascal mailing list