Closed dsnopek closed 5 months ago
I tested it, work good.
Thanks for the testing and review!~
Cherry-picked for 4.2 in PR https://github.com/godotengine/godot-cpp/pull/1465
Cherry-picked for 4.1 in PR https://github.com/godotengine/godot-cpp/pull/1466
It's already a compile-time error if you make a class without a
_bind_methods()
that descends from a native class (likeNode
,Control
, etc).But as pointed out on issue https://github.com/godotengine/godot-cpp/issues/1430, if you make a class that descends from another extension class, there won't be a compile-time error because the parent class's
_bind_methods()
will get picked up, and some things won't work correctly (ex virtual method registration, like_ready()
, as mentioned in the issue).This PR attempts to make it a compile-time error if the class doesn't have its own
_bind_methods()
, ignoring any_bind_methods()
inherited from its parent class.This seems to work in my testing on GCC!
Fixes https://github.com/godotengine/godot-cpp/issues/1430