OLD | NEW |
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 // Test async/await syntax. | 5 // Test async/await syntax. |
6 | 6 |
7 import 'dart:async' show Stream; | 7 import 'dart:async' show Stream; |
8 | 8 |
9 var yield = 0; | 9 var yield = 0; |
10 var await = 0; | 10 var await = 0; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 var d01b = () async* => null; d01b(); /// d01b: compile
-time error | 161 var d01b = () async* => null; d01b(); /// d01b: compile
-time error |
162 var d01c = () sync* => null; d01c(); /// d01c: compile
-time error | 162 var d01c = () sync* => null; d01c(); /// d01c: compile
-time error |
163 var d02a = () async {}; d02a(); /// d02a: ok | 163 var d02a = () async {}; d02a(); /// d02a: ok |
164 var d03a = () async* {}; d03a(); /// d03a: ok | 164 var d03a = () async* {}; d03a(); /// d03a: ok |
165 var d04a = () sync* {}; d04a(); /// d04a: ok | 165 var d04a = () sync* {}; d04a(); /// d04a: ok |
166 var d04b = () sync {}; d04b(); /// d04b: compile
-time error | 166 var d04b = () sync {}; d04b(); /// d04b: compile
-time error |
167 var d05a = () async { await 0; }; d05a(); /// d05a: ok | 167 var d05a = () async { await 0; }; d05a(); /// d05a: ok |
168 var d06a = () async { await for (var o in st) {} }; d06a(); /// d06a: ok | 168 var d06a = () async { await for (var o in st) {} }; d06a(); /// d06a: ok |
169 var d07a = () sync* { yield 0; }; d07a(); /// d07a: ok | 169 var d07a = () sync* { yield 0; }; d07a(); /// d07a: ok |
170 var d08a = () sync* { yield* []; }; d08a(); /// d08a: ok | 170 var d08a = () sync* { yield* []; }; d08a(); /// d08a: ok |
171 var d08b = () sync* { yield*0+1; }; d08b(); /// d08b: ok | 171 var d08b = () sync* { yield*0+1; }; d08b(); /// d08b: static
type warning |
172 var d08c = () { yield*0+1; }; d08c(); /// d08c: ok | 172 var d08c = () { yield*0+1; }; d08c(); /// d08c: ok |
173 var d09a = () async* { yield 0; }; d09a(); /// d09a: ok | 173 var d09a = () async* { yield 0; }; d09a(); /// d09a: ok |
174 var d10a = () async* { yield* []; }; d10a(); /// d10a: ok | 174 var d10a = () async* { yield* []; }; d10a(); /// d10a: static
type warning |
175 } | 175 } |
176 | 176 |
177 | 177 |
178 void main() { | 178 void main() { |
179 var a; | 179 var a; |
180 var c = new C(); | 180 var c = new C(); |
181 c = new C.e1(); /// e1: continued | 181 c = new C.e1(); /// e1: continued |
182 c = new C.e2(); /// e2: continued | 182 c = new C.e2(); /// e2: continued |
183 c = new C.e3(); /// e3: continued | 183 c = new C.e3(); /// e3: continued |
184 c = new C.e4(); /// e4: continued | 184 c = new C.e4(); /// e4: continued |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 a = c.async; /// b14c: continued | 267 a = c.async; /// b14c: continued |
268 a = c.async; /// b14d: continued | 268 a = c.async; /// b14d: continued |
269 c.sync(); /// b15a: continued | 269 c.sync(); /// b15a: continued |
270 c.sync(); /// b15b: continued | 270 c.sync(); /// b15b: continued |
271 c.async(); /// b15c: continued | 271 c.async(); /// b15c: continued |
272 c.async(); /// b15d: continued | 272 c.async(); /// b15d: continued |
273 | 273 |
274 method1(); | 274 method1(); |
275 method2(); | 275 method2(); |
276 } | 276 } |
OLD | NEW |