Skip to content

GDScript: Call static methods in native base class#93298

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
rune-scape:call-native-static
Feb 20, 2026
Merged

GDScript: Call static methods in native base class#93298
Repiteo merged 1 commit into
godotengine:masterfrom
rune-scape:call-native-static

Conversation

@rune-scape

@rune-scape rune-scape commented Jun 18, 2024

Copy link
Copy Markdown
Contributor

allows calling the static methods of the native base on a gdscript object at runtime

fixes #111021

@rune-scape rune-scape requested a review from a team as a code owner June 18, 2024 10:18
@dalexeev dalexeev modified the milestones: 4.4, 4.3 Jun 18, 2024
@dalexeev dalexeev added bug and removed enhancement labels Jun 18, 2024
Comment thread modules/gdscript/gdscript.cpp Outdated
Comment thread modules/gdscript/gdscript.cpp Outdated
@rune-scape rune-scape force-pushed the call-native-static branch 3 times, most recently from eaf8329 to a35ccaa Compare July 4, 2024 01:07
@rune-scape rune-scape requested a review from dalexeev July 4, 2024 01:18

@dalexeev dalexeev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for delay. Could you use an already existing static method for the test? For example, JSON.stringify().

class MyJSON extends JSON:
    pass

func test():
    print(MyJSON.stringify("test"))
@vnen vnen modified the milestones: 4.3, 4.4 Jul 25, 2024
@rune-scape rune-scape force-pushed the call-native-static branch from a35ccaa to 79bae01 Compare July 27, 2024 20:32
@rune-scape

rune-scape commented Jul 27, 2024

Copy link
Copy Markdown
Contributor Author

@dalexeev done, didn't find that in my initial search for existing static methods

@rune-scape rune-scape requested a review from dalexeev January 25, 2025 08:39
@Repiteo Repiteo modified the milestones: 4.4, 4.5 Feb 24, 2025
@Repiteo Repiteo modified the milestones: 4.5, 4.6 Sep 8, 2025
@rune-scape rune-scape requested a review from a team as a code owner September 22, 2025 02:54
@Repiteo Repiteo modified the milestones: 4.6, 4.x Jan 26, 2026
Comment thread modules/gdscript/gdscript.cpp Outdated

@dalexeev dalexeev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. 👍 Just a few code style changes. Sorry for the long wait.

Comment thread modules/gdscript/gdscript.cpp Outdated
Comment thread modules/gdscript/gdscript.cpp Outdated
Comment thread modules/gdscript/gdscript.cpp Outdated
@rune-scape

Copy link
Copy Markdown
Contributor Author

long wait indeed lol,, thank you both for ur reviews!

@dalexeev dalexeev modified the milestones: 4.x, 4.7 Feb 19, 2026
@Repiteo Repiteo merged commit 4d4f588 into godotengine:master Feb 20, 2026
39 of 40 checks passed
@Repiteo

Repiteo commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@rune-scape rune-scape deleted the call-native-static branch February 24, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment