summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_analyzer.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-04 13:32:47 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-04 13:32:47 +0100
commitb392ab5ff4ecaf8834ce22801ac8856b2e5f8293 (patch)
tree016f4bf858e9eaeb3793e633536964751ba8d212 /modules/gdscript/gdscript_analyzer.cpp
parent8eb08522b3a1826f78f5d732fc10421d61f7ed27 (diff)
parent24181d10552e3bedca05f1f0a470eb29a2d93975 (diff)
downloadredot-engine-b392ab5ff4ecaf8834ce22801ac8856b2e5f8293.tar.gz
Merge pull request #85918 from 20kdc/tnj-static-called-on-instance-fix-confusion
GDScript: Adjust `STATIC_CALLED_ON_INSTANCE` warning to not force native type
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 98d4a19a87..3ec5098c21 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -3360,12 +3360,8 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a
parser->push_warning(p_call, GDScriptWarning::RETURN_VALUE_DISCARDED, p_call->function_name);
}
- if (method_flags.has_flag(METHOD_FLAG_STATIC) && !is_constructor && !base_type.is_meta_type && !(is_self && static_context)) {
- String caller_type = String(base_type.native_type);
-
- if (caller_type.is_empty()) {
- caller_type = base_type.to_string();
- }
+ if (method_flags.has_flag(METHOD_FLAG_STATIC) && !is_constructor && !base_type.is_meta_type && !is_self) {
+ String caller_type = base_type.to_string();
parser->push_warning(p_call, GDScriptWarning::STATIC_CALLED_ON_INSTANCE, p_call->function_name, caller_type);
}