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

Side by Side Diff: tests/language_strong/malbounded_type_test2_test.dart

Issue 2765893003: Fix warnings_checker.dart handling of multitests (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 isCheckedMode() { 7 isCheckedMode() {
8 try { 8 try {
9 var i = 1; 9 var i = 1;
10 String s = i; 10 String s = i;
11 return false; 11 return false;
12 } catch (e) { 12 } catch (e) {
13 return true; 13 return true;
14 } 14 }
15 } 15 }
16 16
17 class A<T extends num> { } 17 class A<T extends num> { }
18 18
19 class B<T> { 19 class B<T> {
20 test() { 20 test() {
21 new A() is A<T>; // /// static type warning 21 new A() is A<T>; // //# static type warning
22 } 22 }
23 } 23 }
24 24
25 main () { 25 main () {
26 var b = new B<String>(); 26 var b = new B<String>();
27 if (isCheckedMode()) { 27 if (isCheckedMode()) {
28 Expect.throws(() => b.test(), (e) => e is TypeError); 28 Expect.throws(() => b.test(), (e) => e is TypeError);
29 } else { 29 } else {
30 b.test(); 30 b.test();
31 } 31 }
32 } 32 }
OLDNEW
« no previous file with comments | « tests/language_strong/malbounded_type_cast_test.dart ('k') | tests/language_strong/malbounded_type_test_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698