Skip to content
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

GDScript: Add check for super() methods not being implemented #81808

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

anvilfolk
Copy link
Contributor

Brings back what I believe is the OK part of #77324. When checking a super() call in GDScript, we know what the base class is, and can check up the class hierarchy whether the method exists.

The reason that part of #77324 was reverted was because in the general case, when calling any method on any object (e.g. a random node in the scene tree), we can't guarantee that the object doesn't have a script attached (that we don't know of) that implements the method. I don't think this can happen here, because it is specifically for super() calls.

Fixes #81804.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and seems to be working correctly.
Also fixes #76938

Copy link
Member

@adamscott adamscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh and ready for 4.2.

@adamscott adamscott added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Sep 17, 2023
@anvilfolk
Copy link
Contributor Author

Force push was just the comment fixes! :)

@akien-mga akien-mga merged commit 3d3a9ee into godotengine:master Sep 19, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@anvilfolk anvilfolk deleted the super-virtual branch September 19, 2023 12:24
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling super() when base implementation does not exist doesn't give any error until runtime
6 participants