mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
GDScript: Fix STANDALONE_EXPRESSION warning for preload()
This commit is contained in:
parent
5708a3a02e
commit
7dd801c580
8 changed files with 30 additions and 7 deletions
|
|
@ -3394,6 +3394,7 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a
|
|||
}
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
// FIXME: No warning for built-in constructors and utilities due to early return.
|
||||
if (p_is_root && return_type.kind != GDScriptParser::DataType::UNRESOLVED && return_type.builtin_type != Variant::NIL &&
|
||||
!(p_call->is_super && p_call->function_name == GDScriptLanguage::get_singleton()->strings._init)) {
|
||||
parser->push_warning(p_call, GDScriptWarning::RETURN_VALUE_DISCARDED, p_call->function_name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue