[fpc-devel] Modifiers...

Michael Van Canneyt michael at freepascal.org
Tue Jan 30 14:01:34 CET 2024



On Tue, 30 Jan 2024, Hairy Pixels via fpc-devel wrote:

>
>
>> On Jan 30, 2024, at 3:56 AM, Michael Van Canneyt via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
>> 
>> Unfortunately I still don't understand after your explanation what adding 'final' is supposed to accomplish. It may well be legitimate, but I have currently no opinion as I don't understand it.
>
> Final means there is no possible implementation in another subclass so the
> compiler doesn't need to invoke the method via the vtable.  Ideally this
> works on the class level too because it's a useful optimization.

Yes, that is one of the effects. I understood that part.

It's probably more correct to say that you don't want there to be an override
in a descendent class. Offhand I can't think of a use-case, but why not...

Michael.


More information about the fpc-devel mailing list