[fpc-pascal] with in classes/records

Ryan Joseph ryan at thealchemistguild.com
Mon Sep 3 17:00:50 CEST 2018



> On Sep 3, 2018, at 9:17 PM, Martin <fpc at mfriebe.de> wrote:
> 
> You.f.Free;
> will always work, it is not ambiguous.
> 
> You.Free;
> depends on no method Free being declared on the class of You, or any of its base classes, or any other default class (if more than one is allowed) that would be searched at higher priority.

sorry I just wanted to add, in the case of You.Free where there is an naming conflicting in super classes (Free in TObject of 3 classes) the rule is:

1) *always* use the base classes implementation regardless of order.
2) if you want an implementation other than the base class you must explicitly call on that field.

That should be easy to follow I think. Even if that’s not complete or correct we can assign very strict rules which force the programmer into explicit calls when naming conflicts exist.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list