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

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

Issue 895673005: Add static type checking of "yield*" statements to analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix tests. Created 5 years, 10 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 | Annotate | Revision Log
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 // 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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/static_type_warning_code_test.dart ('k') | tests/language/language_analyzer.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698