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

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

Issue 2768073002: Format all 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Test instantiation of object with malbounded types. 5 // Test instantiation of object with malbounded types.
6 6
7 class A<T 7 class A<
8 T
8 extends num //# 01: static type warning 9 extends num //# 01: static type warning
9 > {} 10 > {}
11
10 class B<T> implements A<T> {} 12 class B<T> implements A<T> {}
11 class C<T 13
14 class C<
15 T
12 extends num //# 01: continued 16 extends num //# 01: continued
13 > implements B<T> {} 17 > implements B<T> {}
14 18
15 class Class<T> { 19 class Class<T> {
16 newA() { 20 newA() {
17 new A<T>(); //# 01: continued 21 new A<T>(); //# 01: continued
18 } 22 }
19 newB() { 23 newB() {
20 new B<T>(); //# 01: continued 24 new B<T>(); //# 01: continued
21 } 25 }
22 newC() { 26 newC() {
23 new C<T>(); //# 01: continued 27 new C<T>(); //# 01: continued
(...skipping 16 matching lines...) Expand all
40 if (expectTypeError && inCheckedMode()) { 44 if (expectTypeError && inCheckedMode()) {
41 throw 'Missing type error instantiating ${v.runtimeType}'; 45 throw 'Missing type error instantiating ${v.runtimeType}';
42 } 46 }
43 } on TypeError catch (e) { 47 } on TypeError catch (e) {
44 if (!expectTypeError || !inCheckedMode()) { 48 if (!expectTypeError || !inCheckedMode()) {
45 throw 'Unexpected type error: $e'; 49 throw 'Unexpected type error: $e';
46 } 50 }
47 } 51 }
48 } 52 }
49 53
50
51 void main() { 54 void main() {
52 test(false, () => new A<int>()); 55 test(false, () => new A<int>());
53 test(false, () => new B<int>()); 56 test(false, () => new B<int>());
54 test(false, () => new C<int>()); 57 test(false, () => new C<int>());
55 58
56 test(true, () => new A<String>()); //# 01: continued 59 test(true, () => new A<String>()); //# 01: continued
57 test(true, () => new B<String>()); //# 01: continued 60 test(true, () => new B<String>()); //# 01: continued
58 test(true, () => new C<String>()); //# 01: continued 61 test(true, () => new C<String>()); //# 01: continued
59 62
60 var c = new Class<int>(); 63 var c = new Class<int>();
61 test(false, () => c.newA()); 64 test(false, () => c.newA());
62 test(false, () => c.newB()); 65 test(false, () => c.newB());
63 test(false, () => c.newC()); 66 test(false, () => c.newC());
64 67
65 c = new Class<String>(); 68 c = new Class<String>();
66 test(true, () => c.newA()); //# 01: continued 69 test(true, () => c.newA()); //# 01: continued
67 test(true, () => c.newB()); //# 01: continued 70 test(true, () => c.newB()); //# 01: continued
68 test(true, () => c.newC()); //# 01: continued 71 test(true, () => c.newC()); //# 01: continued
69 } 72 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698