Index: runtime/vm/parser.cc |
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc |
index 5a00eed55abd78bcab906aab20fb82157e5c0c77..8706a10540b3185c1426fe7a79a1cecd2f701ab5 100644 |
--- a/runtime/vm/parser.cc |
+++ b/runtime/vm/parser.cc |
@@ -11472,12 +11472,11 @@ AstNode* Parser::ParseExpr(bool require_compiletime_const, |
} |
const Token::Kind assignment_op = CurrentToken(); |
const TokenPosition assignment_pos = TokenPos(); |
- ConsumeToken(); |
- const TokenPosition right_expr_pos = TokenPos(); |
- if (require_compiletime_const && (assignment_op != Token::kASSIGN)) { |
- ReportError(right_expr_pos, |
+ if (require_compiletime_const) { |
+ ReportError(assignment_pos, |
"expression is not a valid compile-time constant"); |
} |
+ ConsumeToken(); |
AstNode* right_expr = ParseExpr(require_compiletime_const, consume_cascades); |
if (assignment_op != Token::kASSIGN) { |
// Compound assignment: store inputs with side effects into temp. locals. |