[fpc-devel] Modifiers...

Hairy Pixels genericptr at gmail.com
Tue Jan 30 02:25:35 CET 2024



> On Jan 29, 2024, at 3:53 PM, Sven Barth via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
> 
> A person that overrides virtual methods does not always have control over whether the method had been declared as virtual. With "final" the user can tell the compiler that this method won't be overriden anymore and thus the compiler can change virtual method calls to direct method calls (assuming the compiler knows the class type involved for sure). It's similar to the WPO devirtualisation pass the compiler supports just without the need to compile the code twice.

I  brought this up recently. Does final on classes actually do this or just final on methods? I didn't know you could even mark a method as "final" until now.

Regards,
Ryan Joseph



More information about the fpc-devel mailing list