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

Unified Diff: sdk/lib/core/iterable.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
Index: sdk/lib/core/iterable.dart
diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart
index a327b6d54be396b97883c4d96c65764b90d610c9..dd195023655e93658810725bd989c256ea3c339d 100644
--- a/sdk/lib/core/iterable.dart
+++ b/sdk/lib/core/iterable.dart
@@ -156,7 +156,8 @@ abstract class Iterable<E> {
* on any element where the result isn't needed.
* For example, [elementAt] may call `f` only once.
*/
- Iterable map(f(E element)) => new MappedIterable<E, dynamic>(this, f);
+ Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(E e)) =>
+ new MappedIterable<E, dynamic/*=T*/>(this, f);
/**
* Returns a new lazy [Iterable] with all elements that satisfy the
@@ -182,8 +183,8 @@ abstract class Iterable<E> {
* The returned [Iterable] is lazy, and calls [f] for each element
* of this every time it's iterated.
*/
- Iterable expand(Iterable f(E element)) =>
- new ExpandIterable<E, dynamic>(this, f);
+ Iterable/*<T>*/ expand/*<T>*/(Iterable/*<T>*/ f(E element)) =>
+ new ExpandIterable<E, dynamic/*=T*/>(this, f);
/**
* Returns true if the collection contains an element equal to [element].
@@ -270,8 +271,8 @@ abstract class Iterable<E> {
* iterable.fold(0, (prev, element) => prev + element);
*
*/
- dynamic fold(var initialValue,
- dynamic combine(var previousValue, E element)) {
+ dynamic/*=T*/ fold/*<T>*/(var/*=T*/ initialValue,
+ dynamic/*=T*/ combine(var/*=T*/ previousValue, E element)) {
var value = initialValue;
for (E element in this) value = combine(value, element);
return value;

Powered by Google App Engine
This is Rietveld 408576698