-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core: Fix Object::has_method()
for script static methods
#82767
Core: Fix Object::has_method()
for script static methods
#82767
Conversation
My take on this very interesting issue: My guts tell me that Then, there has to be a way for an object to include the interface defined by any attached script in its own, for purposes like calling, property setting/getting, and checking the interface for a method by name. This last point has motivated me to check the current implementation of
So, script-wise it will only check the methods in the script if there's an instance. My first thought was to add code to find a static method in the attached script. But that's not right, because the object the |
Since I needed to test my hypothesis, I've done the changes and finally PRd them as #82770. |
To corroborate RandomShaper's review, the compiler warning treated as error in this PR also exposes the same problem:
|
6140ce2
to
042217f
Compare
Object::has_method()
virtualObject::has_method()
for script static methods
Yes, I was confused that this method is called the same in Here's another solution (virtual multi-level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current version of this PR includes the best of all the ideas discussed.
Just a note for the next compat breakage: rename Script::has_(_static)?method()
to Script::has_script_(_static)?method()
(I think the already existing Script::has_script_signal()
and others are named like that to disambiguate).
042217f
to
ed0b3c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GDExtension related changes look good to me! Thanks :-)
Thanks! |
See #79521 (comment).