Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(902)

Unified Diff: runtime/vm/parser.cc

Issue 25456005: Add type check to const conditional expression evaluation (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/ast.cc ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 28166)
+++ runtime/vm/parser.cc (working copy)
@@ -1019,7 +1019,7 @@
if (field.is_const()) {
// This getter will only be called once at compile time.
if (expr->EvalConstExpr() == NULL) {
- ErrorMsg(expr_pos, "initializer must be a compile-time constant");
+ ErrorMsg(expr_pos, "initializer is not a valid compile-time constant");
}
ReturnNode* return_node = new ReturnNode(ident_pos, expr);
current_block_->statements->Add(return_node);
@@ -7657,7 +7657,7 @@
return expr;
}
if (expr->EvalConstExpr() == NULL) {
- ErrorMsg(expr_pos, "expression must be a compile-time constant");
+ ErrorMsg(expr_pos, "expression is not a valid compile-time constant");
}
return new LiteralNode(expr_pos, EvaluateConstExpr(expr));
}
@@ -7827,7 +7827,7 @@
ConsumeToken();
const intptr_t right_expr_pos = TokenPos();
if (require_compiletime_const && (assignment_op != Token::kASSIGN)) {
- ErrorMsg(right_expr_pos, "expression must be a compile-time constant");
+ ErrorMsg(right_expr_pos, "expression is not a valid compile-time constant");
}
AstNode* right_expr = ParseExpr(require_compiletime_const, consume_cascades);
if (assignment_op != Token::kASSIGN) {
« no previous file with comments | « runtime/vm/ast.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698