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

Unified Diff: pkg/compiler/lib/src/util/link.dart

Issue 1783053005: Fix all for-in warnings in dart2js (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
Index: pkg/compiler/lib/src/util/link.dart
diff --git a/pkg/compiler/lib/src/util/link.dart b/pkg/compiler/lib/src/util/link.dart
index 3a9c133982b050f4b78b0dcab15276f39a8ff26e..f84c2c879243c7d181736467062609d9f5b5e9bd 100644
--- a/pkg/compiler/lib/src/util/link.dart
+++ b/pkg/compiler/lib/src/util/link.dart
@@ -4,7 +4,7 @@
part of dart2js.util;
-class Link<T> {
+class Link<T> implements Iterable<T> {
T get head => throw new StateError("no elements");
Link<T> get tail => null;
@@ -120,6 +120,27 @@ class Link<T> {
}
Link copyWithout(e) => this;
+
+ //
+ // Unsupported Iterable<T> methods.
+ //
+ bool any(bool f(T e)) => _unsupported('any');
+ T elementAt(int i) => _unsupported('elementAt');
+ Iterable expand(Iterable f(T e)) => _unsupported('expand');
+ T firstWhere(bool f(T e), {T orElse()}) => _unsupported('firstWhere');
+ fold(initialValue, combine(value, T element)) => _unsupported('fold');
+ T get last => _unsupported('get:last');
+ T lastWhere(bool f(T e), {T orElse()}) => _unsupported('lastWhere');
+ String join([separator = '']) => _unsupported('join');
+ T reduce(T combine(T a, T b)) => _unsupported('reduce');
+ T singleWhere(bool f(T e)) => _unsupported('singleWhere');
+ Iterable<T> skipWhile(bool f(T e)) => _unsupported('skipWhile');
+ Iterable<T> take(int n) => _unsupported('take');
+ Iterable<T> takeWhile(bool f(T e)) => _unsupported('takeWhile');
+ Set<T> toSet() => _unsupported('toSet');
+ Iterable<T> where(bool f(T e)) => _unsupported('where');
+
+ _unsupported(String method) => throw new UnsupportedError(method);
}
/// Builder object for creating linked lists using [Link] or fixed-length [List]

Powered by Google App Engine
This is Rietveld 408576698