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

Unified Diff: sdk/lib/async/stream.dart

Issue 1462743002: add generic method comments to a few SDK methods (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « sdk/lib/async/future.dart ('k') | sdk/lib/collection/iterable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream.dart
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 7766c81a3b0a34fe880b97c6d4a00c779193239d..ae003e3e1bf75b7c163790338b46da22824076fc 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -317,8 +317,8 @@ abstract class Stream<T> {
* If a broadcast stream is listened to more than once, each subscription
* will individually execute `map` for each event.
*/
- Stream map(convert(T event)) {
- return new _MapStream<T, dynamic>(this, convert);
+ Stream/*<S>*/ map/*<S>*/(/*=S*/ convert(T event)) {
+ return new _MapStream<T, dynamic/*=S*/>(this, convert);
}
/**
@@ -479,8 +479,8 @@ abstract class Stream<T> {
* If a broadcast stream is listened to more than once, each subscription
* will individually call `convert` and expand the events.
*/
- Stream expand(Iterable convert(T value)) {
- return new _ExpandStream<T, dynamic>(this, convert);
+ Stream/*<S>*/ expand(Iterable/*<S>*/ convert(T value)) {
Leaf 2016/01/13 00:52:12 I think this is missing the binding site. Should
+ return new _ExpandStream<T, dynamic/*=S*/>(this, convert);
}
/**
@@ -554,7 +554,9 @@ abstract class Stream<T> {
}
/** Reduces a sequence of values by repeatedly applying [combine]. */
- Future fold(var initialValue, combine(var previous, T element)) {
+ Future/*<S>*/ fold/*<S>*/(var/*=S*/ initialValue,
+ /*=S*/ combine(var/*=S*/ previous, T element)) {
+
_Future result = new _Future();
var value = initialValue;
StreamSubscription subscription;
« no previous file with comments | « sdk/lib/async/future.dart ('k') | sdk/lib/collection/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698