You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
GDScript: Fix STANDALONE_EXPRESSION warning for preload()
This commit is contained in:
@@ -1877,6 +1877,10 @@ GDScriptParser::Node *GDScriptParser::parse_statement() {
|
||||
case Node::CALL:
|
||||
// Fine.
|
||||
break;
|
||||
case Node::PRELOAD:
|
||||
// `preload` is a function-like keyword.
|
||||
push_warning(expression, GDScriptWarning::RETURN_VALUE_DISCARDED, "preload");
|
||||
break;
|
||||
case Node::LAMBDA:
|
||||
// Standalone lambdas can't be used, so make this an error.
|
||||
push_error("Standalone lambdas cannot be accessed. Consider assigning it to a variable.", expression);
|
||||
|
||||
Reference in New Issue
Block a user