Skip to content

Commit

Permalink
Merge pull request #49114 from vnen/gdscript-fix-self-function-type-c…
Browse files Browse the repository at this point in the history
…heck

GDScript: Fix function signature check for self calls
  • Loading branch information
akien-mga authored May 26, 2021
2 parents bfcb1d2 + a23fc45 commit 364ea7f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/gdscript/gdscript_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2068,9 +2068,11 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool is_awa

if (p_call->is_super) {
base_type = parser->current_class->base_type;
base_type.is_meta_type = false;
is_self = true;
} else if (callee_type == GDScriptParser::Node::IDENTIFIER) {
base_type = parser->current_class->get_datatype();
base_type.is_meta_type = false;
is_self = true;
} else if (callee_type == GDScriptParser::Node::SUBSCRIPT) {
GDScriptParser::SubscriptNode *subscript = static_cast<GDScriptParser::SubscriptNode *>(p_call->callee);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends Node

func test():
set_name("TestNodeName")
if get_name() == &"TestNodeName":
print("Name is equal")
else:
print("Name is not equal")
print(get_name() is StringName)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
GDTEST_OK
Name is equal
True

0 comments on commit 364ea7f

Please sign in to comment.