Forum > General

A doubt about the visibility specifiers in the classes

<< < (3/3)

simone:

--- Quote from: kupferstecher on July 26, 2022, 12:57:56 pm ---
.... I don't see that the OP demonstarted that the type itself was automatically made public[1], but only that the enum identifiers were made public. And I see the enum identifiers similar to the record member identifiers.

Then it seems these identifiers are automatically made available by the compiler if the type is used as parameter. And "making it available" in the one case is like making it public and in the other case like beeing added to uses.


--- End quote ---

Yes you are right. The enum type is not made public, but the identifiers used in its definition.

Honestly, I'm not sure this behavior is consistent. However, I leave the judgment to more authoritative people.

PascalDragon:

--- Quote from: simone on July 26, 2022, 10:17:49 am ---Why are the values of TMyEnum visible outside the module, even though they have been declared as (strict) private in the class they belong to?

--- End quote ---

It might be that enums and nested types might bite each other a bit here, due how they are to behave in TP and Delphi without nested types. I'll need to crosscheck with those two to decide on what is right and what is wrong.

Navigation

[0] Message Index

[*] Previous page

Go to full version