Skip to content

Commit

Permalink
Merge pull request #73693 from vnen/gdscript-fix-script-signature-check
Browse files Browse the repository at this point in the history
GDScript: Fix override signature check of script inheritance
  • Loading branch information
akien-mga committed Feb 21, 2023
2 parents 31726fa + 1731010 commit 253396b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/gdscript/gdscript_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,7 @@ void GDScriptAnalyzer::resolve_function_signature(GDScriptParser::FunctionNode *
// Check if the function signature matches the parent. If not it's an error since it breaks polymorphism.
// Not for the constructor which can vary in signature.
GDScriptParser::DataType base_type = parser->current_class->base_type;
base_type.is_meta_type = false;
GDScriptParser::DataType parent_return_type;
List<GDScriptParser::DataType> parameters_types;
int default_par_count = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
func test():
print("ok")

# https://github.com/godotengine/godot/issues/71994
class A:
extends RefCounted
class B:
extends A
func duplicate():
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GDTEST_OK
ok

0 comments on commit 253396b

Please sign in to comment.