Merge pull request #49114 from vnen/gdscript-fix-self-function-type-check
GDScript: Fix function signature check for self calls
This commit is contained in:
commit
364ea7f280
|
@ -2068,9 +2068,11 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool is_awa
|
||||||
|
|
||||||
if (p_call->is_super) {
|
if (p_call->is_super) {
|
||||||
base_type = parser->current_class->base_type;
|
base_type = parser->current_class->base_type;
|
||||||
|
base_type.is_meta_type = false;
|
||||||
is_self = true;
|
is_self = true;
|
||||||
} else if (callee_type == GDScriptParser::Node::IDENTIFIER) {
|
} else if (callee_type == GDScriptParser::Node::IDENTIFIER) {
|
||||||
base_type = parser->current_class->get_datatype();
|
base_type = parser->current_class->get_datatype();
|
||||||
|
base_type.is_meta_type = false;
|
||||||
is_self = true;
|
is_self = true;
|
||||||
} else if (callee_type == GDScriptParser::Node::SUBSCRIPT) {
|
} else if (callee_type == GDScriptParser::Node::SUBSCRIPT) {
|
||||||
GDScriptParser::SubscriptNode *subscript = static_cast<GDScriptParser::SubscriptNode *>(p_call->callee);
|
GDScriptParser::SubscriptNode *subscript = static_cast<GDScriptParser::SubscriptNode *>(p_call->callee);
|
||||||
|
|
|
@ -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)
|
|
@ -0,0 +1,3 @@
|
||||||
|
GDTEST_OK
|
||||||
|
Name is equal
|
||||||
|
True
|
Loading…
Reference in a new issue