1
0
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:
Danil Alexeev
2024-05-16 22:11:56 +03:00
parent 5708a3a02e
commit 7dd801c580
8 changed files with 30 additions and 7 deletions

View File

@@ -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);