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

Unified Diff: runtime/vm/parser.cc

Issue 10944041: Ensure that parser throws an error when parsing x is! T with malformed type T. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: make test positive Created 8 years, 3 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 | « no previous file | tests/language/isnot_malformed_type_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 8cb2dc755bad177e9c99a2731f8739cbbb5e8642..949a29ec6cb8a5a109b5ec615291d9b7c9fdbff9 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -6584,7 +6584,8 @@ AstNode* Parser::ParseBinaryExpr(int min_preced) {
CaptureInstantiator();
}
right_operand = new TypeNode(type_pos, type);
- if ((op_kind == Token::kIS) && type.IsMalformed()) {
+ if (((op_kind == Token::kIS) || (op_kind == Token::kISNOT)) &&
+ type.IsMalformed()) {
// Note that a type error is thrown even if the tested value is null
// in a type test. However, no cast exception is thrown if the value
// is null in a type cast.
« no previous file with comments | « no previous file | tests/language/isnot_malformed_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698