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

explicit override keyword for gdscript #3654

Closed
cammytown opened this issue Dec 11, 2021 · 3 comments
Closed

explicit override keyword for gdscript #3654

cammytown opened this issue Dec 11, 2021 · 3 comments

Comments

@cammytown
Copy link

cammytown commented Dec 11, 2021

Describe the project you are working on

An abstract class for exporting/importing Nodes and various data types.

Describe the problem or limitation you are having in your project

I override methods when I need more specific functionality but it feels semantically precarious that I cannot explicitly define that the method is meant to override another.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Allowing the keyword "override" before a function declaration i.e. override func importValue(value, type): like other languages have would help make code more semantically clear and, if the compiler checked for it, further help prevent bugs that come from extending classes that are missing expected methods.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

class One:
	func basicMethod():
		print('one');

class Two extends One:
	override func basicMethod():
		.basicMethod();
		print('and two');

If this enhancement will not be used often, can it be worked around with a few lines of script?

It's just fancy syntax; not strictly necessary.

Is there a reason why this should be core and not an add-on in the asset library?

In the name of making gdscript a competent and powerful language.

@Calinou
Copy link
Member

Calinou commented Dec 11, 2021

Duplicate of #1631.

@era-epoch
Copy link

Was this ever implemented or supported in any way?

@Calinou
Copy link
Member

Calinou commented Apr 15, 2024

Was this ever implemented or supported in any way?

No, see #1631. Earlier Godot versions didn't support this either.

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

No branches or pull requests

3 participants