You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-04 19:21:46 +00:00
Merge pull request #52792 from vnen/gdscript-subscript-missing-index
This commit is contained in:
@@ -2592,6 +2592,10 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_subscript(ExpressionNode *
|
||||
subscript->base = p_previous_operand;
|
||||
subscript->index = parse_expression(false);
|
||||
|
||||
if (subscript->index == nullptr) {
|
||||
push_error(R"(Expected expression after "[".)");
|
||||
}
|
||||
|
||||
pop_multiline();
|
||||
consume(GDScriptTokenizer::Token::BRACKET_CLOSE, R"(Expected "]" after subscription index.)");
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
func test():
|
||||
var array = [1, 2, 3]
|
||||
array[] = 4
|
||||
@@ -0,0 +1,2 @@
|
||||
GDTEST_PARSER_ERROR
|
||||
Expected expression after "[".
|
||||
Reference in New Issue
Block a user