You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-04 19:21:46 +00:00
GDScript: Show error on invalid initializer expression
This commit is contained in:
@@ -844,6 +844,9 @@ GDScriptParser::VariableNode *GDScriptParser::parse_variable(bool p_allow_proper
|
||||
if (match(GDScriptTokenizer::Token::EQUAL)) {
|
||||
// Initializer.
|
||||
variable->initializer = parse_expression(false);
|
||||
if (variable->initializer == nullptr) {
|
||||
push_error(R"(Expected expression for variable initial value after "=".)");
|
||||
}
|
||||
variable->assignments++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user