mirror of
https://github.com/godotengine/godot.git
synced 2025-10-24 02:13:36 +00:00
Add GDScript warning for standalone expression
This makes the error message clearer as it might be used to call functions with side effects.
This commit is contained in:
parent
e7b7dc57fc
commit
7d4fc79eb3
3 changed files with 10 additions and 1 deletions
|
|
@ -8274,7 +8274,11 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
|
|||
_mark_line_as_safe(op->line);
|
||||
_reduce_node_type(op); // Test for safety anyway
|
||||
#ifdef DEBUG_ENABLED
|
||||
_add_warning(GDScriptWarning::STANDALONE_EXPRESSION, statement->line);
|
||||
if (op->op == OperatorNode::OP_TERNARY_IF) {
|
||||
_add_warning(GDScriptWarning::STANDALONE_TERNARY, statement->line);
|
||||
} else {
|
||||
_add_warning(GDScriptWarning::STANDALONE_EXPRESSION, statement->line);
|
||||
}
|
||||
#endif // DEBUG_ENABLED
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue