Earlier, Carl pointed out...
>... "If you declare a method in a derived class with the same name as a
>static method in the ancestor class, the new method simply replaces the
>inherited one in the derived class."
I've been thinking about this some more - this is very disturbing
behaviour.
Suppose i have
type
TBase = class(TObject);
Public
procedure DoSomething;
end;
TDerived = class(TBase);
private
procedure DoSomething;
end;
and elsewhere in some other unit I have some function
procedure TSomeUnit.SomeProc( aBase: TBase );
begin
aBase.DoSomething;
end;
and now in a 3rd unit I have
var aDerived:TDerived;
aDerived:=TDerived.Create;
SomeProc( aBase );
does this call the TBase.Dosomething - even though it's "replaced"
by the derived one?
or does this call the TDerived.DoSomething (since it "replaces" the
inherited version) - effectively circumventing the "Private"?
I haven't tried this yet - but regardless of which happens, isn't
this a bit bizarre? Am I missing something?
-ns
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"