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

Unified Diff: pkg/dev_compiler/tool/input_sdk/lib/async/future.dart

Issue 2696133005: Add generic types to Future.forEach in DDC sdk (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/lib/async/future.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/async/future.dart b/pkg/dev_compiler/tool/input_sdk/lib/async/future.dart
index 49b2460524c27e21f121043531bb7e773e399dfd..5b570c606f6869df24fbe6a621772e8f32634bf5 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/async/future.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/async/future.dart
@@ -418,8 +418,8 @@ abstract class Future<T> {
* If [f] returns a non-[Future], iteration continues immediately. Otherwise
* it waits for the returned [Future] to complete.
*/
- static Future forEach(Iterable input, f(element)) {
- Iterator iterator = input.iterator;
+ static Future forEach<T>(Iterable<T> input, f(T element)) {
+ var iterator = input.iterator;
return doWhile(() {
if (!iterator.moveNext()) return false;
return new Future.sync(() => f(iterator.current)).then((_) => true);
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698