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

Unified Diff: tests/language/generic_list_checked_test.dart

Issue 15735003: Use assertSubtype for lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 7 years, 7 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 | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/generic_list_checked_test.dart
diff --git a/tests/language/interceptor7_test.dart b/tests/language/generic_list_checked_test.dart
similarity index 57%
copy from tests/language/interceptor7_test.dart
copy to tests/language/generic_list_checked_test.dart
index 965ddfc800c1b1fa7971bd918391b1e806c00cf3..fcff24bc2e8e906492bf4e10e4825d337d199018 100644
--- a/tests/language/interceptor7_test.dart
+++ b/tests/language/generic_list_checked_test.dart
@@ -2,15 +2,19 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// Test that dart2js uses the right interceptor when call a method on
-// something that has type number.
-
import 'package:expect/expect.dart';
-var array = [];
+bool inCheckedMode() {
+ try {
+ int i = 'hest';
+ } catch (e) {
+ return true;
+ }
+ return false;
+}
main() {
- array.add(false);
- var x = array[0] ? 1.5 : 2;
- Expect.isTrue(x.isEven);
+ if (inCheckedMode()) {
+ Expect.throws(() { List<int> t = new List<String>(); });
+ }
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698