[fpc-pascal] private type and type compatibility
Jonas Maebe
jonas.maebe at elis.ugent.be
Wed Oct 30 12:56:39 CET 2013
On 30 Oct 2013, at 12:50, Michael Van Canneyt wrote:
> On Wed, 30 Oct 2013, Jonas Maebe wrote:
>
>> It can, as demonstrated by the example that started this thread.
>> The type identifier may not be visible, but entities that have this
>> type can be. Just like in the unit example.
>
> You must admit that in the case of a function result type, that is a
> bit awkward, since you will never be able to declare a properly
> typed variable to hold the function result. In the case of a record
> or class type, that is particularly awkward since you will be forced
> to use a "with" to access the various fields.
Absolutely, but it's always been valid in TP/Delphi/FPC-style Pascal
and introducing a special rule would make the language less orthogonal.
Jonas
More information about the fpc-pascal
mailing list