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

Unified Diff: tests/language/src/MapLiteral1NegativeTest.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/MapLiteral1NegativeTest.dart
diff --git a/tests/language/src/MapLiteral1NegativeTest.dart b/tests/language/src/MapLiteral1NegativeTest.dart
index 5490091049b8413c05a0c45ba0b3222b4416dd1a..3f819df2a424ccdbacfedbb03eded4f567aff826 100644
--- a/tests/language/src/MapLiteral1NegativeTest.dart
+++ b/tests/language/src/MapLiteral1NegativeTest.dart
@@ -3,20 +3,15 @@
// BSD-style license that can be found in the LICENSE file.
// VMOptions=--enable_type_checks
//
-// Dart test program testing type checks in map literals.
+// When type checks are enabled, a type mismatch in an array literal is a compile-time error
scheglov 2012/01/26 15:54:42 "array literal"? Probably "map literal".
zundel 2012/01/26 17:39:51 Done.
-class MapLiteral1NegativeTest {
- test() {
- try {
- var m = const <String>{"a": 0}; // 0 is not a String.
- } catch (TypeError error) {
- }
+main() {
+ try {
+ var m = const <String>{"a": 0}; // 0 is not a String.
+ } catch (TypeError error) {
+ // not a catchable error
}
}
-main() {
- var t = new MapLiteral1NegativeTest();
- t.test();
-}
« tests/language/src/ListLiteral4Test.dart ('K') | « tests/language/src/ListLiteral4Test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698