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

Unified Diff: sdk/lib/collection/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/collection/iterable.dart
diff --git a/sdk/lib/collection/iterable.dart b/sdk/lib/collection/iterable.dart
index e89acc6f1ca91a1a4b5cafe0501da3d5e21c7757..c0d2ee053be9ec890ab9bff660b35a4085176594 100644
--- a/sdk/lib/collection/iterable.dart
+++ b/sdk/lib/collection/iterable.dart
@@ -15,12 +15,13 @@ abstract class IterableMixin<E> implements Iterable<E> {
// - SetMixin
// If changing a method here, also change the other copies.
- Iterable map(f(E element)) => new MappedIterable<E, dynamic>(this, f);
+ Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(E element)) =>
+ new MappedIterable<E, dynamic/*=T*/>(this, f);
Iterable<E> where(bool f(E element)) => new WhereIterable<E>(this, f);
- 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);
bool contains(Object element) {
for (E e in this) {
@@ -45,8 +46,8 @@ abstract class IterableMixin<E> implements Iterable<E> {
return value;
}
- 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