summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_analyzer.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-07 14:07:53 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-07 14:07:53 +0100
commit5386289ee2d7af990030f3d2a3c06d8b530cb05a (patch)
tree017c1133bfb64e83bc8bac73d7251868dfc8a47a /modules/gdscript/gdscript_analyzer.cpp
parentf5a0e18015f3b7a61cb8271912c22efb8642a72e (diff)
parent0fef203b1f39c3373f9f25b8e75e75f6b03f7c88 (diff)
Merge pull request #72144 from adamscott/fix-super-class-check
Remove script class checks when getting function signature
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index cd1dcf9a78..78e437b42a 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -3017,7 +3017,7 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a
push_error(vformat(R"*(Cannot call non-static function "%s()" from static function "%s()".)*", p_call->function_name, parent_function->identifier->name), p_call);
} else if (!is_self && base_type.is_meta_type && !is_static) {
base_type.is_meta_type = false; // For `to_string()`.
- push_error(vformat(R"*(Cannot call non-static function "%s()" on the class "%s" directly. Make an instance instead.)*", p_call->function_name, base_type.to_string()), p_call);
+ push_error(vformat(R"*(Cannot call non-static function "%s()" on a class directly. Make an instance instead.)*", p_call->function_name), p_call);
} else if (is_self && !is_static) {
mark_lambda_use_self();
}
@@ -4564,16 +4564,6 @@ bool GDScriptAnalyzer::get_function_signature(GDScriptParser::Node *p_source, bo
base_script = base_script->get_base_script();
}
- // If the base is a script, it might be trying to access members of the Script class itself.
- if (p_base_type.is_meta_type && !p_is_constructor && (p_base_type.kind == GDScriptParser::DataType::SCRIPT || p_base_type.kind == GDScriptParser::DataType::CLASS)) {
- MethodInfo info;
- StringName script_class = p_base_type.kind == GDScriptParser::DataType::SCRIPT ? p_base_type.script_type->get_class_name() : StringName(GDScript::get_class_static());
-
- if (ClassDB::get_method_info(script_class, function_name, &info)) {
- return function_signature_from_info(info, r_return_type, r_par_types, r_default_arg_count, r_static, r_vararg);
- }
- }
-
if (p_is_constructor) {
// Native types always have a default constructor.
r_return_type = p_base_type;