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

Unified Diff: runtime/vm/parser.cc

Issue 8677019: Fix build breakage. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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 | « no previous file | 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 1813)
+++ runtime/vm/parser.cc (working copy)
@@ -6640,8 +6640,10 @@
AstNode* elem = list->ElementAt(i);
// Arguments have been evaluated to a literal value already.
ASSERT(elem->IsLiteralNode());
- if (!element_type.IsDynamicType() &&
- !elem->AsLiteralNode()->literal().Is(element_type)) {
+ if (FLAG_enable_type_checks &&
+ !element_type.IsDynamicType() &&
+ !elem->AsLiteralNode()->literal().
+ IsAssignableTo(element_type, TypeArguments::Handle())) {
ErrorMsg(elem->AsLiteralNode()->token_index(),
"list literal element at index %d must be "
"a constant of type '%s'",
@@ -6798,9 +6800,11 @@
AstNode* arg = kv_pairs->ElementAt(i);
// Arguments have been evaluated to a literal value already.
ASSERT(arg->IsLiteralNode());
- if (((i % 2) == 1) && // Check values only, not keys.
+ if (FLAG_enable_type_checks &&
+ ((i % 2) == 1) && // Check values only, not keys.
!value_type.IsDynamicType() &&
- !arg->AsLiteralNode()->literal().Is(value_type)) {
+ !arg->AsLiteralNode()->literal().
+ IsAssignableTo(value_type, TypeArguments::Handle())) {
ErrorMsg(arg->AsLiteralNode()->token_index(),
"map literal value at index %d must be "
"a constant of type '%s'",
« no previous file with comments | « no previous file | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698