<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Adriaan van Os via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> schrieb am Mi., 11. Okt. 2023, 06:25:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sven Barth via fpc-pascal wrote:<br>
> Am 10.10.2023 um 11:18 schrieb Adriaan van Os via fpc-pascal:<br>
>><br>
>>><br>
>>> - In the released compiler, if you remove all visibility specifiers, <br>
>>> you can<br>
>>>   get a list by specifying {$M+} on your base object and then list all<br>
>>>   published methods using the RTTI.<br>
>><br>
>> My understanding is that I have to explicitely specify public for <br>
>> class fields, otherwise the compiler will issue an error.<br>
> <br>
> What exactly do you mean here? Do you have an example?<br>
<br>
{$mode macpas}<br>
{$M+}<br>
program testrtti;<br>
type<br>
   T = object( TObject)<br>
     i: integer;<br>
     procedure A;<br>
   end;<br>
procedure T.A;<br>
   begin end;<br>
begin<br>
end.<br>
<br>
Free Pascal Compiler version 3.0.4 [2018/09/30] for x86_64<br>
Copyright (c) 1993-2017 by Florian Klaempfl and others<br>
Target OS: Darwin for x86_64<br>
Compiling testrtti.pas<br>
testrtti.pas(6,5) Error: Symbol cannot be published, can be only a class<br>
testrtti.pas(13) Fatal: There were 1 errors compiling module, stopping<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Ah, yes, only classes and interfaces can be used for published fields. For properties anything is allowed. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>