> On Jan 29, 2024, at 3:53 PM, Sven Barth via fpc-devel 
> <fpc-devel@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

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to