[fpc-pascal] private type and type compatibility
Michael Van Canneyt
michael at freepascal.org
Wed Oct 30 12:20:31 CET 2013
On Wed, 30 Oct 2013, Sven Barth wrote:
> Am 30.10.2013 11:59, schrieb Jonas Maebe:
>>
>> problem to use it. It's of course not exactly the same (tdynarray isn't
>> declared as private to u1), but at the scope visibility level it is the
>> same situation as far as I am concerned.
> Hmm... but here the compiler can not know whether the unit using u2 has unit
> u1 in scope or not. In case of private and protected types the compiler can
> know however that code declared externally can never have access to it
My thoughts exactly.
In the case of units, the user CAN make it visible (as in : directly accessible)
by adding the unit to the uses clause. He can never do this for the private type.
Michael.
More information about the fpc-pascal
mailing list