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

Unified Diff: test/dart_codegen/expect/_internal/iterable.dart

Issue 1010893004: Allow S->T <: dynamic->T (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Add comment Created 5 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: test/dart_codegen/expect/_internal/iterable.dart
diff --git a/test/dart_codegen/expect/_internal/iterable.dart b/test/dart_codegen/expect/_internal/iterable.dart
index 631b3a21c5abfef07e344513848a26ee8fdd4b44..2eb278b9e8d3d66835fa5d5118bbd9052ab61de4 100644
--- a/test/dart_codegen/expect/_internal/iterable.dart
+++ b/test/dart_codegen/expect/_internal/iterable.dart
@@ -136,11 +136,7 @@ int length = this.length;
}
}
Iterable<E> where(bool test(E element)) => super.where(test);
- Iterable map(f(E element)) => new MappedListIterable(this, DEVC$RT.wrap((dynamic f(E __u0)) {
-dynamic c(E x0) => f(DEVC$RT.cast(x0, dynamic, E, "CastParam", """line 175, column 62 of dart:_internal/iterable.dart: """, x0 is E, false));
- return f == null ? null : c;
-}
-, f, null, __t1, "Wrap", """line 175, column 62 of dart:_internal/iterable.dart: """, f is __t1));
+ Iterable map(f(E element)) => new MappedListIterable(this, f);
E reduce(E combine(var value, E element)) {
int length = this.length;
if (length == 0) throw IterableElementError.noElement();
@@ -339,7 +335,13 @@ _current = _f(_iterator.current);
class WhereIterable<E> extends IterableBase<E> {final Iterable<E> _iterable;
final _ElementPredicate _f;
WhereIterable(this._iterable, bool this._f(E element));
- Iterator<E> get iterator => new WhereIterator<E>(_iterable.iterator, _f);
+ Iterator<E> get iterator => new WhereIterator<E>(_iterable.iterator, DEVC$RT.wrap((bool f(dynamic __u0)) {
+bool c(dynamic x0) => f(x0);
+ return f == null ? null : c;
+}
+, _f, null, DEVC$RT.type((__t1<E> _) {
+}
+), "Wrap", """line 425, column 72 of dart:_internal/iterable.dart: """, _f is __t1<E>));
}
class WhereIterator<E> extends Iterator<E> {final Iterator<E> _iterator;
final _ElementPredicate _f;
@@ -444,7 +446,13 @@ if (_remaining < 0) return null;
final _ElementPredicate _f;
TakeWhileIterable(this._iterable, bool this._f(E element));
Iterator<E> get iterator {
-return new TakeWhileIterator<E>(_iterable.iterator, _f);
+return new TakeWhileIterator<E>(_iterable.iterator, DEVC$RT.wrap((bool f(dynamic __u13)) {
+bool c(dynamic x0) => f(x0);
+ return f == null ? null : c;
+}
+, _f, null, DEVC$RT.type((__t14<E> _) {
+}
+), "Wrap", """line 555, column 57 of dart:_internal/iterable.dart: """, _f is __t14<E>));
}
}
class TakeWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator;
@@ -511,7 +519,13 @@ for (int i = 0; i < _skipCount; i++) _iterator.moveNext();
final _ElementPredicate _f;
SkipWhileIterable(this._iterable, bool this._f(E element));
Iterator<E> get iterator {
-return new SkipWhileIterator<E>(_iterable.iterator, _f);
+return new SkipWhileIterator<E>(_iterable.iterator, DEVC$RT.wrap((bool f(dynamic __u16)) {
+bool c(dynamic x0) => f(x0);
+ return f == null ? null : c;
+}
+, _f, null, DEVC$RT.type((__t17<E> _) {
+}
+), "Wrap", """line 648, column 57 of dart:_internal/iterable.dart: """, _f is __t17<E>));
}
}
class SkipWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator;
@@ -530,9 +544,9 @@ if (!_f(_iterator.current)) return true;
E get current => _iterator.current;
}
class EmptyIterable<E> extends IterableBase<E> implements EfficientLength {const EmptyIterable();
- Iterator<E> get iterator => ((__x13) => DEVC$RT.cast(__x13, null, DEVC$RT.type((Iterator<E> _) {
+ Iterator<E> get iterator => ((__x19) => DEVC$RT.cast(__x19, null, DEVC$RT.type((Iterator<E> _) {
}
-), "CastExact", """line 678, column 31 of dart:_internal/iterable.dart: """, __x13 is Iterator<E>, false))(const EmptyIterator());
+), "CastExact", """line 678, column 31 of dart:_internal/iterable.dart: """, __x19 is Iterator<E>, false))(const EmptyIterator());
void forEach(void action(E element)) {
}
bool get isEmpty => true;
@@ -764,7 +778,13 @@ return new WhereIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dynami
}
), DEVC$RT.type((Iterable<T> _) {
}
-), "CastDynamic", """line 961, column 33 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), f);
+), "CastDynamic", """line 961, column 33 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), DEVC$RT.wrap((bool f(dynamic __u20)) {
+bool c(dynamic x0) => f(x0);
+ return f == null ? null : c;
+}
+, f, null, DEVC$RT.type((__t21<T> _) {
+}
+), "Wrap", """line 961, column 43 of dart:_internal/iterable.dart: """, f is __t21<T>));
}
static Iterable map(Iterable iterable, f(var element)) {
return new MappedIterable(iterable, f);
@@ -787,7 +807,13 @@ return new TakeWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy
}
), DEVC$RT.type((Iterable<T> _) {
}
-), "CastDynamic", """line 983, column 37 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), test);
+), "CastDynamic", """line 983, column 37 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), DEVC$RT.wrap((bool f(dynamic __u23)) {
+bool c(dynamic x0) => f(x0);
+ return f == null ? null : c;
+}
+, test, null, DEVC$RT.type((__t21<T> _) {
+}
+), "Wrap", """line 983, column 47 of dart:_internal/iterable.dart: """, test is __t21<T>));
}
Iterable<T> skipList(List list, int n) {
return new SubListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _) {
@@ -801,7 +827,13 @@ return new SkipWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy
}
), DEVC$RT.type((Iterable<T> _) {
}
-), "CastDynamic", """line 993, column 37 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), test);
+), "CastDynamic", """line 993, column 37 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), DEVC$RT.wrap((bool f(dynamic __u24)) {
+bool c(dynamic x0) => f(x0);
+ return f == null ? null : c;
+}
+, test, null, DEVC$RT.type((__t21<T> _) {
+}
+), "Wrap", """line 993, column 47 of dart:_internal/iterable.dart: """, test is __t21<T>));
}
Iterable<T> reversedList(List list) {
return new ReversedListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _) {
@@ -811,15 +843,7 @@ return new ReversedListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic
), "CastDynamic", """line 997, column 40 of dart:_internal/iterable.dart: """, list is Iterable<T>, false));
}
static void sortList(List list, int compare(a, b)) {
-if (compare == null) compare = DEVC$RT.wrap((int f(Comparable<dynamic> __u14, Comparable<dynamic> __u15)) {
-int c(Comparable<dynamic> x0, Comparable<dynamic> x1) => f(DEVC$RT.cast(x0, dynamic, DEVC$RT.type((Comparable<dynamic> _) {
-}
-), "CastParam", """line 1001, column 36 of dart:_internal/iterable.dart: """, x0 is Comparable<dynamic>, true), DEVC$RT.cast(x1, dynamic, DEVC$RT.type((Comparable<dynamic> _) {
-}
-), "CastParam", """line 1001, column 36 of dart:_internal/iterable.dart: """, x1 is Comparable<dynamic>, true));
- return f == null ? null : c;
-}
-, Comparable.compare, __t19, __t16, "Wrap", """line 1001, column 36 of dart:_internal/iterable.dart: """, Comparable.compare is __t16);
+if (compare == null) compare = Comparable.compare;
Sort.sort(list, compare);
}
static void shuffleList(List list, Random random) {
@@ -969,9 +993,10 @@ result.add(element);
static StateError tooMany() => new StateError("Too many elements");
static StateError tooFew() => new StateError("Too few elements");
}
- typedef dynamic __t1(dynamic __u2);
- typedef dynamic __t3<E>(E __u4);
+ typedef bool __t1<E>(E __u2);
+ typedef bool __t3(dynamic __u4);
typedef Iterable<T> __t7<S, T>(S __u8);
typedef Iterable<dynamic> __t9(dynamic __u10);
- typedef int __t16(dynamic __u17, dynamic __u18);
- typedef int __t19(Comparable<dynamic> __u20, Comparable<dynamic> __u21);
+ typedef bool __t14<E>(E __u15);
+ typedef bool __t17<E>(E __u18);
+ typedef bool __t21<T>(T __u22);

Powered by Google App Engine
This is Rietveld 408576698