[fpc-devel] "class of TFoo".Create

Zoë Peterson zoe at scootersoftware.com
Sun Jul 6 16:17:42 CEST 2025


> I would personally call that unusual at best


What do you two expect this construct to do that you think the current behavior is wrong? It’sobviously correct and expected to me as a fundamental  part of Object Pascal’s polymorphism. Constructing an object from a class reference is the entire reason that constructors are virtual. It’s how things like TPicture.Graphic are implemented to create the correct image loading object. 

Zoë Peterson
Scooter Software




More information about the fpc-devel mailing list