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

Side by Side Diff: tests/language_2/generalized_void_syntax_test.dart

Issue 3008573002: Migrate test block 113 to Dart 2.0. (Closed)
Patch Set: Merge fixups Created 3 years, 3 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
« no previous file with comments | « tests/language_2/gc_test.dart ('k') | tests/language_2/generic2_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 // Testing that the reserved word `void` is allowed to occur as a type, not 5 // Testing that the reserved word `void` is allowed to occur as a type, not
6 // just as a return type. 6 // just as a return type.
7 7
8 class A<T> { 8 class A<T> {
9 final T t; 9 final T t;
10 const A(this.t); 10 const A(this.t);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 A<void> get g4 => new A<void>(null); 61 A<void> get g4 => new A<void>(null);
62 void set s3(void x) => null; 62 void set s3(void x) => null;
63 void set s4(A<void> x) => null; 63 void set s4(A<void> x) => null;
64 void m5(void x, [void y]) => null; 64 void m5(void x, [void y]) => null;
65 void m6(void x, {void y}) => null; 65 void m6(void x, {void y}) => null;
66 A<void> m7(A<void> x, [A<void> y]) => null; 66 A<void> m7(A<void> x, [A<void> y]) => null;
67 A<void> m8(A<void> x, {A<void> y}) => null; 67 A<void> m8(A<void> x, {A<void> y}) => null;
68 68
69 // Ensure that all members are used, and use `void` in expressions. 69 // Ensure that all members are used, and use `void` in expressions.
70 void run() { 70 void run() {
71 var ignore = [ 71 List<dynamic> ignore = [
72 x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, // 72 x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, //
73 g1, g2, g3, g4, 73 g1, g2, g3, g4,
74 ]; 74 ];
75 75
76 s1 = null; 76 s1 = null;
77 s2 = new A<void>(null); 77 s2 = new A<void>(null);
78 s3 = null; 78 s3 = null;
79 s4 = new A<void>(null); 79 s4 = new A<void>(null);
80 m1(null, null); 80 m1(null, null);
81 m2(null, y: null); 81 m2(null, y: null);
82 m3(null, new A<void>(null)); 82 m3(null, new A<void>(null));
83 m4(null, y: new A<void>(null)); 83 m4(null, y: new A<void>(null));
84 m5(null, null); 84 m5(null, null);
85 m6(null, y: null); 85 m6(null, y: null);
86 m7(null, new A<void>(null)); 86 m7(null, new A<void>(null));
87 m8(null, y: new A<void>(null)); 87 m8(null, y: new A<void>(null));
88 88
89 void pretendToUse(dynamic x) => null; 89 void pretendToUse(dynamic x) => null;
90 pretendToUse(<void>[]); 90 pretendToUse(<void>[]);
91 pretendToUse(<void, void>{}); 91 pretendToUse(<void, void>{});
92 pretendToUse(<A<void>>[]); 92 pretendToUse(<A<void>>[]);
93 pretendToUse(<A<void>, A<void>>{}); 93 pretendToUse(<A<void>, A<void>>{});
94 } 94 }
95 } 95 }
96 96
97 // Testing syntax, just enforce compilation. 97 // Testing syntax, just enforce compilation.
98 main() { 98 main() {
99 var ignore = [x1, x2, x3, x4, x5, x6, x7, x8, g1, g2]; 99 List<dynamic> ignore = [x1, x2, x3, x4, x5, x6, x7, x8, g1, g2];
100 100
101 s1 = null; 101 s1 = null;
102 s2 = new A<void>(null); 102 s2 = new A<void>(null);
103 m1(null, null); 103 m1(null, null);
104 m2(null, y: null); 104 m2(null, y: null);
105 m3(null, null); 105 m3(null, null);
106 m4(null, y: null); 106 m4(null, y: null);
107 new C().run(); 107 new C().run();
108 } 108 }
OLDNEW
« no previous file with comments | « tests/language_2/gc_test.dart ('k') | tests/language_2/generic2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698