Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/util/link.dart |
| diff --git a/pkg/front_end/lib/src/fasta/util/link.dart b/pkg/front_end/lib/src/fasta/util/link.dart |
| index a8f1b653ef7bd9a45a6ff5a59269feff956a99e1..b25e6af4c8bd804b20b17af0f438386b5a76bbe7 100644 |
| --- a/pkg/front_end/lib/src/fasta/util/link.dart |
| +++ b/pkg/front_end/lib/src/fasta/util/link.dart |
| @@ -40,8 +40,8 @@ class Link<T> implements Iterable<T> { |
| } |
| /// Lazily maps over this linked list, returning an [Iterable]. |
| - Iterable map(dynamic fn(T item)) { |
| - return new MappedLinkIterable<T, dynamic>(this, fn); |
| + Iterable<K> map<K>(K fn(T item)) { |
| + return new MappedLinkIterable<T, K>(this, fn); |
| } |
| /// Invokes `fn` for every item in the linked list and returns the results |
| @@ -94,7 +94,7 @@ class Link<T> implements Iterable<T> { |
| int slowLength() => 0; |
| // TODO(ahe): Remove this method? |
| - bool contains(T element) { |
| + bool contains(Object element) { |
| for (Link<T> link = this; !link.isEmpty; link = link.tail) { |
| if (link.head == element) return true; |
| } |
| @@ -131,9 +131,9 @@ class Link<T> implements Iterable<T> { |
| // |
| bool any(bool f(T e)) => _unsupported('any'); |
| T elementAt(int i) => _unsupported('elementAt'); |
| - Iterable expand(Iterable f(T e)) => _unsupported('expand'); |
| + Iterable<K> expand<K>(Iterable<K> f(T e)) => _unsupported('expand'); |
| T firstWhere(bool f(T e), {T orElse()}) => _unsupported('firstWhere'); |
| - fold(initialValue, combine(value, T element)) => _unsupported('fold'); |
| + K fold<K>(K initialValue, K combine(K value, T element)) => _unsupported('fold'); |
|
ahe
2017/02/07 11:03:08
Long line.
Siggi Cherem (dart-lang)
2017/02/07 21:59:26
Done.
|
| T get last => _unsupported('get:last'); |
| T lastWhere(bool f(T e), {T orElse()}) => _unsupported('lastWhere'); |
| String join([separator = '']) => _unsupported('join'); |
| @@ -151,7 +151,7 @@ class Link<T> implements Iterable<T> { |
| /// Builder object for creating linked lists using [Link] or fixed-length [List] |
| /// objects. |
| abstract class LinkBuilder<T> { |
| - factory LinkBuilder() = LinkBuilderImplementation; |
| + factory LinkBuilder() = LinkBuilderImplementation<T>; |
| /// Prepends all elements added to the builder to [tail]. The resulting list |
| /// is returned and the builder is cleared. |