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

Side by Side Diff: tests/language/mixin_super_bound_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 bool inCheckedMode() { 7 bool inCheckedMode() {
8 try { 8 try {
9 var i = 42; 9 var i = 42;
10 String s = i; 10 String s = i;
11 } on TypeError catch (e) { 11 } on TypeError catch (e) {
12 return true; 12 return true;
13 } 13 }
14 return false; 14 return false;
15 } 15 }
16 16
17 class M<U extends V, V> { } 17 class M<U extends V, V> {}
18 18
19 class N<U, V extends U> { } 19 class N<U, V extends U> {}
20 20
21 class S<T> { } 21 class S<T> {}
22 22
23 class MNA<U, V, W> extends S<List<U>> with M<V, U>, N<List<W>, List<W>> { } 23 class MNA<U, V, W> extends S<List<U>> with M<V, U>, N<List<W>, List<W>> {}
24 24
25 class MNA2<U, V, W> = S<List<U>> with M<V, U>, N<List<W>, List<W>>; 25 class MNA2<U, V, W> = S<List<U>> with M<V, U>, N<List<W>, List<W>>;
26 26
27 main() { 27 main() {
28 new MNA<num, int, bool>(); 28 new MNA<num, int, bool>();
29 new MNA2<num, int, bool>(); 29 new MNA2<num, int, bool>();
30 if (inCheckedMode()) { 30 if (inCheckedMode()) {
31 // Type parameter U of M must extend type parameter V, but 31 // Type parameter U of M must extend type parameter V, but
32 // type argument num is not a subtype of int. 32 // type argument num is not a subtype of int.
33 Expect.throws(() => new MNA<int, num, bool>(), (e) => e is TypeError); 33 Expect.throws(() => new MNA<int, num, bool>(), (e) => e is TypeError);
34 // Type parameter U of M must extend type parameter V, but 34 // Type parameter U of M must extend type parameter V, but
35 // type argument num is not a subtype of int. 35 // type argument num is not a subtype of int.
36 Expect.throws(() => new MNA2<int, num, bool>(), (e) => e is TypeError); 36 Expect.throws(() => new MNA2<int, num, bool>(), (e) => e is TypeError);
37 } else { 37 } else {
38 new MNA<int, num, bool>(); 38 new MNA<int, num, bool>();
39 new MNA2<int, num, bool>(); 39 new MNA2<int, num, bool>();
40 } 40 }
41 } 41 }
42
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698