[fpc-devel] Status report for "class helpers"
Sven Barth
pascaldragon at googlemail.com
Sat Jan 29 17:58:06 CET 2011
On 29.01.2011 17:45, Paul Ishenin wrote:
> 29.01.2011 23:41, Paul Ishenin wrote:
>> I also noticed that you check only unit symtables. I don't know what
>> if you add a class helper into a record/class/object type section?
>
> This code works in delphi:
>
> program Project42;
>
> {$APPTYPE CONSOLE}
>
> type
> TFoo = class
> class procedure DoSomething; static;
> type
> TFooHelper = class helper for TFoo
> class procedure HelpSomehow; static;
> end;
> end;
>
> { TFoo.TFooHelper }
>
> class procedure TFoo.TFooHelper.HelpSomehow;
> begin
> WriteLn('In Help somehow');
> end;
>
> { TFoo }
>
> class procedure TFoo.DoSomething;
> begin
> WriteLn('In DoSomething');
> end;
>
> begin
> TFoo.DoSomething;
> TFoo.HelpSomehow;
> end.
This is one of those moments where I need to restrain myself to not
swear for the whole world to hear...
*sigh*
Does the nested class helper adhere to visibility rules? E.g. if you
make it "strict private" or "strict protected" does it still work? Or if
you put the class in another unit and lower the visibility somewhere
below public? (I can't test now, because I have Delphi only at work)
Regards,
Sven
More information about the fpc-devel
mailing list