-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Overriding static methods has highly inconsistent, context-dependent behavior #77895
Comments
The behavior on instances should be corrected, but by "override failed" do you mean that you consider it incorrect? As I see it the first range of results should be matched in the second, as that is in my opinion the correct way to treat static methods |
Somewhere in between. I was using language borrowed from #72973 rather than trying to express an opinion. On the other hand, that bug report disagreed with you. My opinion isn't very informed, but personally I would prefer if overriding static methods worked the same way as overriding other methods. That just strikes me as more intuitive. I know other languages work differently, though, and again my opinion isn't worth much. |
Disagrees how?
And as I said, I was just stating my opinion, and there's currently no officially "right" way, and I just wanted to clarify as your report was unclear I would argue that the first results follows the principle of least astonishment the most, and matches the immediate assumptions of "static", but it's a matter of interpretation |
I meant that the earlier bug report (not any comments on it) probably used that language because it considered the "override failed" behavior a bug. I didn't intend for this report to have the same connotation (even though it does represent my stance). |
Thank you for reporting, consolidating in: See there for more details, if you think something was missed about this and it's not the same issue, please comment here and it can be reopened |
Godot version
4.1.dev4, 4.0.3, 3.5.2, and everything in between, probably more
System information
Windows 11
Issue description
This is best explained with an example:
This behavior is inconsistent and illogical:
Two.new().b()
correctly callsTwo.new().a()
, butTwo.new().c()
doesn't correctly callTwo.new().b()
and somehow ends up circling back toOne.a()
. Very, very strange.Closely related to #72973, but builds on it substantially
Steps to reproduce
Use the example code above
Minimal reproduction project
N/A, the script above can be used to easily reproduce the issue
The text was updated successfully, but these errors were encountered: