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

Unified Diff: sdk/lib/collection/iterable.dart

Issue 2529393002: Make core libraries use generic method syntax. (Closed)
Patch Set: Update status files. Created 3 years, 12 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 | « sdk/lib/async/zone.dart ('k') | sdk/lib/collection/list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/iterable.dart
diff --git a/sdk/lib/collection/iterable.dart b/sdk/lib/collection/iterable.dart
index edfce8515bdf2b7b37125dc8f5e48706c3fa4652..c0fc8120ef26184fb686e4f38ee42efe96624c8b 100644
--- a/sdk/lib/collection/iterable.dart
+++ b/sdk/lib/collection/iterable.dart
@@ -15,13 +15,13 @@ abstract class IterableMixin<E> implements Iterable<E> {
// - SetMixin
// If changing a method here, also change the other copies.
- Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(E element)) =>
- new MappedIterable<E, dynamic/*=T*/>(this, f);
+ Iterable<T> map<T>(T f(E element)) =>
+ new MappedIterable<E, T>(this, f);
Iterable<E> where(bool f(E element)) => new WhereIterable<E>(this, f);
- Iterable/*<T>*/ expand/*<T>*/(Iterable/*<T>*/ f(E element)) =>
- new ExpandIterable<E, dynamic/*=T*/>(this, f);
+ Iterable<T> expand<T>(Iterable<T> f(E element)) =>
+ new ExpandIterable<E, T>(this, f);
bool contains(Object element) {
for (E e in this) {
@@ -46,8 +46,8 @@ abstract class IterableMixin<E> implements Iterable<E> {
return value;
}
- dynamic/*=T*/ fold/*<T>*/(var/*=T*/ initialValue,
- dynamic/*=T*/ combine(var/*=T*/ previousValue, E element)) {
+ T fold<T>(T initialValue,
+ T combine(T previousValue, E element)) {
var value = initialValue;
for (E element in this) value = combine(value, element);
return value;
« no previous file with comments | « sdk/lib/async/zone.dart ('k') | sdk/lib/collection/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698