[fpc-pascal] Inherited and not virtual/overridden procedures

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Jun 12 13:39:39 CEST 2013


On 12 Jun 2013, at 13:33, Bart wrote:

> On 6/12/13, Jonas Maebe <jonas.maebe at elis.ugent.be> 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 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.


Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130612/161e8a55/attachment.html>


More information about the fpc-pascal mailing list