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

Unified Diff: tests/language/src/ListLiteral1NegativeTest.dart

Issue 9289029: Added runtime type checking to the elements of list and map literals in dartc (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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
Index: tests/language/src/ListLiteral1NegativeTest.dart
diff --git a/tests/language/src/ListLiteral1NegativeTest.dart b/tests/language/src/ListLiteral1NegativeTest.dart
index e95522bd2ad6bb8c4579693906aed62507ebe149..2aa07167427809297532461e77e6c45c3aa16234 100644
--- a/tests/language/src/ListLiteral1NegativeTest.dart
+++ b/tests/language/src/ListLiteral1NegativeTest.dart
@@ -3,20 +3,16 @@
// BSD-style license that can be found in the LICENSE file.
// VMOptions=--enable_type_checks
//
-// Dart test program testing type checks in list literals.
+// When type checks are enabled, a type mismatch in an array literal is a compile-time error
-class ListLiteral1NegativeTest {
- test() {
- try {
- var m = const <String>[0, 1]; // 0 is not a String.
- } catch (TypeError error) {
- }
+main() {
+ try {
+ var m = const <String>[0, 1]; // 0 is not a String.
+ } catch (TypeError error) {
+ // not a catchable error
}
}
-main() {
- var t = new ListLiteral1NegativeTest();
- t.test();
-}
+

Powered by Google App Engine
This is Rietveld 408576698