The document says " Finalizers do not participate in Polymorphism, and cannot have Virtuality Modifiers." Then why in Island platform source code FileStream.pas, I saw this Finalizer with override modifier?
Because they’re implied to be virtual/override. The compiler adds that for you (and forces the inherited call). The requirement here is that all finalizers end up calling their base method.
@ck
I am not sure if I understand your point correctly, but the following code ONLY has Child.Finalizer get called. Parent.Finalizer is not called? Did I miss anything?
FinalizerTest.7z (4.4 KB)
That’s very odd. The generated code looks perfectly fine, yet i see it doesn’t hit the first. Fixed.