On 6/12/13, Jonas Maebe wrote:
> Now change the variable type to TFoo but keep instantiating it using
> TFooChild.Create (like I originally suggested). Having that work is
> the whole point of polymorphism and why virtual/override exist.
I didn't even know that was possible
OK now I see the
On Wed, Jun 12, 2013 at 2:39 PM, Max Vlasov wrote:
> Overall looking at all cases I think this keyword can be considered as a
> good universal prefix excluding the context of the existing class working
> with methods and properties. Even looking at the name it has more to do with
> INHERITance tha
On 12 Jun 2013, at 13:33, Bart wrote:
On 6/12/13, Jonas Maebe wrote:
So that it would still have the same behaviour if you changed the
variable
declaration to
var
FooChild: TFoo;
If I change FooChild to TFoo (and instantiate with TFoo.Create) the
Now change the variable type to TFoo
On Wed, Jun 12, 2013 at 2:12 AM, Bart wrote:
>
> I thought that if I had a subclass that inherited form a parentclass,
> and both have a method with the same name (Bar), then the method of
> the subclass hid the method of the parentclass, and you could not call
> inherited Bar in the subclass.
>
On 6/12/13, Jonas Maebe wrote:
> So that it would still have the same behaviour if you changed the variable
> declaration to
>
> var
> FooChild: TFoo;
If I change FooChild to TFoo (and instantiate with TFoo.Create) the
outut is always the same, wether or not I use virtual for TFoo.Bar and
weth
On 12 Jun 2013, at 00:12, Bart wrote:
> var
> FooChild: TFooChild;
>
> begin
> FooChild := TFooChild.Create;
> FooChild.Bar;
> FooChild.Free;
> end.
>
> To my surprise this compiles without any warning or error.
> It outputs:
> C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test
> TFoo.Bar
Hi,
I thought that if I had a subclass that inherited form a parentclass,
and both have a method with the same name (Bar), then the method of
the subclass hid the method of the parentclass, and you could not call
inherited Bar in the subclass.
More specifically I was under the impression that you