GDScript: Fix function signature check for self calls

This commit is contained in:
George Marques 2021-05-26 15:33:18 -03:00
parent 313e1f62bb
commit a23fc45727
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
3 changed files with 14 additions and 0 deletions

View file

@ -2059,9 +2059,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);

View file

@ -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)

View file

@ -0,0 +1,3 @@
GDTEST_OK
Name is equal
True