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

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

Issue 794953002: Fix a couple type bugs in dart html and what seems like strange type choices in dart:core (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 22698195763f08b01f423ac5f95c37e9583c25ed..154d19c2ddee9180cdcb9137cf4d3b3270d1fe7d 100644
--- a/sdk/lib/collection/iterable.dart
+++ b/sdk/lib/collection/iterable.dart
@@ -147,7 +147,7 @@ abstract class IterableMixin<E> implements Iterable<E> {
return result;
}
- dynamic firstWhere(bool test(E value), { Object orElse() }) {
+ E firstWhere(bool test(E value), { E orElse() }) {
vsm 2014/12/11 01:16:22 Hmm, I guess the intent here is that orElse may re
kevmoo 2014/12/11 01:23:54 But this is not the signature of the same methods
Jacob 2014/12/11 17:32:23 Agreed. As far as I can tell this is just an overs
for (E element in this) {
if (test(element)) return element;
}
@@ -155,7 +155,7 @@ abstract class IterableMixin<E> implements Iterable<E> {
throw IterableElementError.noElement();
}
- dynamic lastWhere(bool test(E value), { Object orElse() }) {
+ E lastWhere(bool test(E value), { E orElse() }) {
E result = null;
bool foundMatching = false;
for (E element in this) {
@@ -343,7 +343,7 @@ abstract class IterableBase<E> implements Iterable<E> {
return result;
}
- dynamic firstWhere(bool test(E value), { Object orElse() }) {
+ E firstWhere(bool test(E value), { E orElse() }) {
for (E element in this) {
if (test(element)) return element;
}
@@ -351,7 +351,7 @@ abstract class IterableBase<E> implements Iterable<E> {
throw IterableElementError.noElement();
}
- dynamic lastWhere(bool test(E value), { Object orElse() }) {
+ E lastWhere(bool test(E value), { E orElse() }) {
E result = null;
bool foundMatching = false;
for (E element in this) {
« no previous file with comments | « no previous file | sdk/lib/html/html_common/css_class_set.dart » ('j') | sdk/lib/html/html_common/css_class_set.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698