nerdsupremacist / GraphZahl

A Framework to implement Declarative, Type-Safe GraphQL Server APIs using Runtime Magic 🎩

Home Page:https://quintero.io/GraphZahl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting a class `final` prevents using functions or compute properties

mbarnach opened this issue · comments

When a class is set final, the compute properties or the functions are not working anymore.
This can be tested with any samples of the README.
If the behaviour is expected, maybe adding this to the README could help troubleshooting the issue.

This behavior is known but undocumented. the reason behind it is that we read the symbols on the vtable to get a list of methods and their signatures. Vtables are there to dispatch method calls to the right implementation of the actual class. If a class is final, Swift will optimize to us static method dispatching and won't create the table at all. Methods in extensions are also omitted for the same reason, since you can't override them. I believe a method will also be omitted if the method is final.

This definitely needs to be documented, thanks for raising this issue!