[fpc-pascal] All methods vitrual ?

Michael Van Canneyt michael at freepascal.org
Wed Oct 11 16:13:54 CEST 2023



On Wed, 11 Oct 2023, Adriaan van Os via fpc-pascal wrote:

> Sven Barth via fpc-pascal wrote:
>
>> Ah, yes, only classes and interfaces can be used for published fields. For 
>> properties anything is allowed. 
>
> However, what makes the whole thing unuseable is that with {$M-} the compiler 
> doesn't accept "published". So, without using macros, the same source code 
> can not be compiled with both {$M+} and {$M-}. That is really clumsy. With 
> {$M-} "published" (or some other visibility specifier) should be equal to 
> "public".

Of course not.

$M controls the inclusion of RTTI, i.e. it allows or disallows the use of the published section.
No more, no less.

It has no impact on the other visibilities whatsoever. 
And that will not change, if only for Delphi compatibility.

If this is not acceptable, then you will need to wait for the extended RTTI or use fcl-passrc 
to solve your need.

Michael.


More information about the fpc-pascal mailing list