mirror of
https://github.com/godotengine/godot.git
synced 2025-10-28 04:04:24 +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
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue