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
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to