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

Side by Side Diff: test/dart_codegen/expect/_internal/iterable.dart

Issue 1038213003: Downward inference (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Rebase Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 part of dart._internal; 1 part of dart._internal;
2 abstract class EfficientLength {int get length; 2 abstract class EfficientLength {int get length;
3 } 3 }
4 abstract class ListIterable<E> extends IterableBase<E> implements EfficientLeng th {int get length; 4 abstract class ListIterable<E> extends IterableBase<E> implements EfficientLeng th {int get length;
5 E elementAt(int i); 5 E elementAt(int i);
6 const ListIterable(); 6 const ListIterable();
7 Iterator<E> get iterator => new ListIterator<E>(this); 7 Iterator<E> get iterator => new ListIterator<E>(this);
8 void forEach(void action(E element)) { 8 void forEach(void action(E element)) {
9 int length = this.length; 9 int length = this.length;
10 for (int i = 0; i < length; i++) { 10 for (int i = 0; i < length; i++) {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } 361 }
362 ), "CastResult", """line 454, column 76 of dart:_internal/iterable.dart: """, __ x0 is Iterable<T>, false))(f(x0)); 362 ), "CastResult", """line 454, column 76 of dart:_internal/iterable.dart: """, __ x0 is Iterable<T>, false))(f(x0));
363 return f == null ? null : c; 363 return f == null ? null : c;
364 } 364 }
365 , _f, null, DEVC$RT.type((__t2<S, T> _) { 365 , _f, null, DEVC$RT.type((__t2<S, T> _) {
366 } 366 }
367 ), "Wrap", """line 454, column 76 of dart:_internal/iterable.dart: """, _f is __ t2<S, T>)); 367 ), "Wrap", """line 454, column 76 of dart:_internal/iterable.dart: """, _f is __ t2<S, T>));
368 } 368 }
369 class ExpandIterator<S, T> implements Iterator<T> {final Iterator<S> _iterator; 369 class ExpandIterator<S, T> implements Iterator<T> {final Iterator<S> _iterator;
370 final _ExpandFunction _f; 370 final _ExpandFunction _f;
371 Iterator<T> _currentExpansion = ((__x6) => DEVC$RT.cast(__x6, null, DEVC$RT.typ e((Iterator<T> _) { 371 Iterator<T> _currentExpansion = const EmptyIterator<T>();
372 }
373 ), "InferableAllocation", """line 463, column 35 of dart:_internal/iterable.dart : """, __x6 is Iterator<T>, false))(const EmptyIterator());
374 T _current; 372 T _current;
375 ExpandIterator(this._iterator, Iterable<T> this._f(S element)); 373 ExpandIterator(this._iterator, Iterable<T> this._f(S element));
376 void _nextExpansion() { 374 void _nextExpansion() {
377 } 375 }
378 T get current => _current; 376 T get current => _current;
379 bool moveNext() { 377 bool moveNext() {
380 if (_currentExpansion == null) return false; 378 if (_currentExpansion == null) return false;
381 while (!_currentExpansion.moveNext()) { 379 while (!_currentExpansion.moveNext()) {
382 _current = null; 380 _current = null;
383 if (_iterator.moveNext()) { 381 if (_iterator.moveNext()) {
384 _currentExpansion = null; 382 _currentExpansion = null;
385 _currentExpansion = ((__x7) => DEVC$RT.cast(__x7, DEVC$RT.type((Iterator<dynami c> _) { 383 _currentExpansion = ((__x6) => DEVC$RT.cast(__x6, DEVC$RT.type((Iterator<dynami c> _) {
386 } 384 }
387 ), DEVC$RT.type((Iterator<T> _) { 385 ), DEVC$RT.type((Iterator<T> _) {
388 } 386 }
389 ), "CompositeCast", """line 481, column 29 of dart:_internal/iterable.dart: """, __x7 is Iterator<T>, false))(_f(_iterator.current).iterator); 387 ), "CompositeCast", """line 481, column 29 of dart:_internal/iterable.dart: """, __x6 is Iterator<T>, false))(_f(_iterator.current).iterator);
390 } 388 }
391 else { 389 else {
392 return false; 390 return false;
393 } 391 }
394 } 392 }
395 _current = _currentExpansion.current; 393 _current = _currentExpansion.current;
396 return true; 394 return true;
397 } 395 }
398 } 396 }
399 class TakeIterable<E> extends IterableBase<E> {final Iterable<E> _iterable; 397 class TakeIterable<E> extends IterableBase<E> {final Iterable<E> _iterable;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 } 431 }
434 E get current { 432 E get current {
435 if (_remaining < 0) return null; 433 if (_remaining < 0) return null;
436 return _iterator.current; 434 return _iterator.current;
437 } 435 }
438 } 436 }
439 class TakeWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable ; 437 class TakeWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable ;
440 final _ElementPredicate _f; 438 final _ElementPredicate _f;
441 TakeWhileIterable(this._iterable, bool this._f(E element)); 439 TakeWhileIterable(this._iterable, bool this._f(E element));
442 Iterator<E> get iterator { 440 Iterator<E> get iterator {
443 return new TakeWhileIterator<E>(_iterable.iterator, DEVC$RT.wrap((bool f(dynamic __u8)) { 441 return new TakeWhileIterator<E>(_iterable.iterator, DEVC$RT.wrap((bool f(dynamic __u7)) {
444 bool c(dynamic x0) => f(x0); 442 bool c(dynamic x0) => f(x0);
445 return f == null ? null : c; 443 return f == null ? null : c;
446 } 444 }
447 , _f, null, DEVC$RT.type((__t9<E> _) { 445 , _f, null, DEVC$RT.type((__t8<E> _) {
448 } 446 }
449 ), "Wrap", """line 555, column 57 of dart:_internal/iterable.dart: """, _f is __ t9<E>)); 447 ), "Wrap", """line 555, column 57 of dart:_internal/iterable.dart: """, _f is __ t8<E>));
450 } 448 }
451 } 449 }
452 class TakeWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator; 450 class TakeWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator;
453 final _ElementPredicate _f; 451 final _ElementPredicate _f;
454 bool _isFinished = false; 452 bool _isFinished = false;
455 TakeWhileIterator(this._iterator, bool this._f(E element)); 453 TakeWhileIterator(this._iterator, bool this._f(E element));
456 bool moveNext() { 454 bool moveNext() {
457 if (_isFinished) return false; 455 if (_isFinished) return false;
458 if (!_iterator.moveNext() || !_f(_iterator.current)) { 456 if (!_iterator.moveNext() || !_f(_iterator.current)) {
459 _isFinished = true; 457 _isFinished = true;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 for (int i = 0; i < _skipCount; i++) _iterator.moveNext(); 504 for (int i = 0; i < _skipCount; i++) _iterator.moveNext();
507 _skipCount = 0; 505 _skipCount = 0;
508 return _iterator.moveNext(); 506 return _iterator.moveNext();
509 } 507 }
510 E get current => _iterator.current; 508 E get current => _iterator.current;
511 } 509 }
512 class SkipWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable ; 510 class SkipWhileIterable<E> extends IterableBase<E> {final Iterable<E> _iterable ;
513 final _ElementPredicate _f; 511 final _ElementPredicate _f;
514 SkipWhileIterable(this._iterable, bool this._f(E element)); 512 SkipWhileIterable(this._iterable, bool this._f(E element));
515 Iterator<E> get iterator { 513 Iterator<E> get iterator {
516 return new SkipWhileIterator<E>(_iterable.iterator, DEVC$RT.wrap((bool f(dynamic __u13)) { 514 return new SkipWhileIterator<E>(_iterable.iterator, DEVC$RT.wrap((bool f(dynamic __u12)) {
517 bool c(dynamic x0) => f(x0); 515 bool c(dynamic x0) => f(x0);
518 return f == null ? null : c; 516 return f == null ? null : c;
519 } 517 }
520 , _f, null, DEVC$RT.type((__t14<E> _) { 518 , _f, null, DEVC$RT.type((__t13<E> _) {
521 } 519 }
522 ), "Wrap", """line 648, column 57 of dart:_internal/iterable.dart: """, _f is __ t14<E>)); 520 ), "Wrap", """line 648, column 57 of dart:_internal/iterable.dart: """, _f is __ t13<E>));
523 } 521 }
524 } 522 }
525 class SkipWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator; 523 class SkipWhileIterator<E> extends Iterator<E> {final Iterator<E> _iterator;
526 final _ElementPredicate _f; 524 final _ElementPredicate _f;
527 bool _hasSkipped = false; 525 bool _hasSkipped = false;
528 SkipWhileIterator(this._iterator, bool this._f(E element)); 526 SkipWhileIterator(this._iterator, bool this._f(E element));
529 bool moveNext() { 527 bool moveNext() {
530 if (!_hasSkipped) { 528 if (!_hasSkipped) {
531 _hasSkipped = true; 529 _hasSkipped = true;
532 while (_iterator.moveNext()) { 530 while (_iterator.moveNext()) {
533 if (!_f(_iterator.current)) return true; 531 if (!_f(_iterator.current)) return true;
534 } 532 }
535 } 533 }
536 return _iterator.moveNext(); 534 return _iterator.moveNext();
537 } 535 }
538 E get current => _iterator.current; 536 E get current => _iterator.current;
539 } 537 }
540 class EmptyIterable<E> extends IterableBase<E> implements EfficientLength {cons t EmptyIterable(); 538 class EmptyIterable<E> extends IterableBase<E> implements EfficientLength {cons t EmptyIterable();
541 Iterator<E> get iterator => ((__x16) => DEVC$RT.cast(__x16, null, DEVC$RT.type( (Iterator<E> _) { 539 Iterator<E> get iterator => const EmptyIterator<E>();
542 }
543 ), "InferableAllocation", """line 678, column 31 of dart:_internal/iterable.dart : """, __x16 is Iterator<E>, false))(const EmptyIterator());
544 void forEach(void action(E element)) { 540 void forEach(void action(E element)) {
545 } 541 }
546 bool get isEmpty => true; 542 bool get isEmpty => true;
547 int get length => 0; 543 int get length => 0;
548 E get first { 544 E get first {
549 throw IterableElementError.noElement(); 545 throw IterableElementError.noElement();
550 } 546 }
551 E get last { 547 E get last {
552 throw IterableElementError.noElement(); 548 throw IterableElementError.noElement();
553 } 549 }
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 buffer.write(list[i]); 761 buffer.write(list[i]);
766 } 762 }
767 } 763 }
768 return buffer.toString(); 764 return buffer.toString();
769 } 765 }
770 Iterable<T> where(Iterable iterable, bool f(var element)) { 766 Iterable<T> where(Iterable iterable, bool f(var element)) {
771 return new WhereIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dynami c> _) { 767 return new WhereIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dynami c> _) {
772 } 768 }
773 ), DEVC$RT.type((Iterable<T> _) { 769 ), DEVC$RT.type((Iterable<T> _) {
774 } 770 }
775 ), "CompositeCast", """line 961, column 33 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), DEVC$RT.wrap((bool f(dynamic __u17)) { 771 ), "CompositeCast", """line 961, column 33 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), DEVC$RT.wrap((bool f(dynamic __u15)) {
776 bool c(dynamic x0) => f(x0); 772 bool c(dynamic x0) => f(x0);
777 return f == null ? null : c; 773 return f == null ? null : c;
778 } 774 }
779 , f, null, DEVC$RT.type((__t18<T> _) { 775 , f, null, DEVC$RT.type((__t16<T> _) {
780 } 776 }
781 ), "Wrap", """line 961, column 43 of dart:_internal/iterable.dart: """, f is __t 18<T>)); 777 ), "Wrap", """line 961, column 43 of dart:_internal/iterable.dart: """, f is __t 16<T>));
782 } 778 }
783 static Iterable map(Iterable iterable, f(var element)) { 779 static Iterable map(Iterable iterable, f(var element)) {
784 return new MappedIterable(iterable, f); 780 return new MappedIterable(iterable, f);
785 } 781 }
786 static Iterable mapList(List list, f(var element)) { 782 static Iterable mapList(List list, f(var element)) {
787 return new MappedListIterable(list, f); 783 return new MappedListIterable(list, f);
788 } 784 }
789 static Iterable expand(Iterable iterable, Iterable f(var element)) { 785 static Iterable expand(Iterable iterable, Iterable f(var element)) {
790 return new ExpandIterable(iterable, f); 786 return new ExpandIterable(iterable, f);
791 } 787 }
792 Iterable<T> takeList(List list, int n) { 788 Iterable<T> takeList(List list, int n) {
793 return new SubListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _) { 789 return new SubListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _) {
794 } 790 }
795 ), DEVC$RT.type((Iterable<T> _) { 791 ), DEVC$RT.type((Iterable<T> _) {
796 } 792 }
797 ), "CompositeCast", """line 978, column 35 of dart:_internal/iterable.dart: """, list is Iterable<T>, false), 0, n); 793 ), "CompositeCast", """line 978, column 35 of dart:_internal/iterable.dart: """, list is Iterable<T>, false), 0, n);
798 } 794 }
799 Iterable<T> takeWhile(Iterable iterable, bool test(var value)) { 795 Iterable<T> takeWhile(Iterable iterable, bool test(var value)) {
800 return new TakeWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy namic> _) { 796 return new TakeWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy namic> _) {
801 } 797 }
802 ), DEVC$RT.type((Iterable<T> _) { 798 ), DEVC$RT.type((Iterable<T> _) {
803 } 799 }
804 ), "CompositeCast", """line 983, column 37 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), DEVC$RT.wrap((bool f(dynamic __u20)) { 800 ), "CompositeCast", """line 983, column 37 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), DEVC$RT.wrap((bool f(dynamic __u18)) {
805 bool c(dynamic x0) => f(x0); 801 bool c(dynamic x0) => f(x0);
806 return f == null ? null : c; 802 return f == null ? null : c;
807 } 803 }
808 , test, null, DEVC$RT.type((__t18<T> _) { 804 , test, null, DEVC$RT.type((__t16<T> _) {
809 } 805 }
810 ), "Wrap", """line 983, column 47 of dart:_internal/iterable.dart: """, test is __t18<T>)); 806 ), "Wrap", """line 983, column 47 of dart:_internal/iterable.dart: """, test is __t16<T>));
811 } 807 }
812 Iterable<T> skipList(List list, int n) { 808 Iterable<T> skipList(List list, int n) {
813 return new SubListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _) { 809 return new SubListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic> _) {
814 } 810 }
815 ), DEVC$RT.type((Iterable<T> _) { 811 ), DEVC$RT.type((Iterable<T> _) {
816 } 812 }
817 ), "CompositeCast", """line 988, column 35 of dart:_internal/iterable.dart: """, list is Iterable<T>, false), n, null); 813 ), "CompositeCast", """line 988, column 35 of dart:_internal/iterable.dart: """, list is Iterable<T>, false), n, null);
818 } 814 }
819 Iterable<T> skipWhile(Iterable iterable, bool test(var value)) { 815 Iterable<T> skipWhile(Iterable iterable, bool test(var value)) {
820 return new SkipWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy namic> _) { 816 return new SkipWhileIterable<T>(DEVC$RT.cast(iterable, DEVC$RT.type((Iterable<dy namic> _) {
821 } 817 }
822 ), DEVC$RT.type((Iterable<T> _) { 818 ), DEVC$RT.type((Iterable<T> _) {
823 } 819 }
824 ), "CompositeCast", """line 993, column 37 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), DEVC$RT.wrap((bool f(dynamic __u21)) { 820 ), "CompositeCast", """line 993, column 37 of dart:_internal/iterable.dart: """, iterable is Iterable<T>, false), DEVC$RT.wrap((bool f(dynamic __u19)) {
825 bool c(dynamic x0) => f(x0); 821 bool c(dynamic x0) => f(x0);
826 return f == null ? null : c; 822 return f == null ? null : c;
827 } 823 }
828 , test, null, DEVC$RT.type((__t18<T> _) { 824 , test, null, DEVC$RT.type((__t16<T> _) {
829 } 825 }
830 ), "Wrap", """line 993, column 47 of dart:_internal/iterable.dart: """, test is __t18<T>)); 826 ), "Wrap", """line 993, column 47 of dart:_internal/iterable.dart: """, test is __t16<T>));
831 } 827 }
832 Iterable<T> reversedList(List list) { 828 Iterable<T> reversedList(List list) {
833 return new ReversedListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic > _) { 829 return new ReversedListIterable<T>(DEVC$RT.cast(list, DEVC$RT.type((List<dynamic > _) {
834 } 830 }
835 ), DEVC$RT.type((Iterable<T> _) { 831 ), DEVC$RT.type((Iterable<T> _) {
836 } 832 }
837 ), "CompositeCast", """line 997, column 40 of dart:_internal/iterable.dart: """, list is Iterable<T>, false)); 833 ), "CompositeCast", """line 997, column 40 of dart:_internal/iterable.dart: """, list is Iterable<T>, false));
838 } 834 }
839 static void sortList(List list, int compare(a, b)) { 835 static void sortList(List list, int compare(a, b)) {
840 if (compare == null) compare = Comparable.compare; 836 if (compare == null) compare = Comparable.compare;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 } 978 }
983 return result; 979 return result;
984 } 980 }
985 } 981 }
986 abstract class IterableElementError {static StateError noElement() => new State Error("No element"); 982 abstract class IterableElementError {static StateError noElement() => new State Error("No element");
987 static StateError tooMany() => new StateError("Too many elements"); 983 static StateError tooMany() => new StateError("Too many elements");
988 static StateError tooFew() => new StateError("Too few elements"); 984 static StateError tooFew() => new StateError("Too few elements");
989 } 985 }
990 typedef Iterable<T> __t2<S, T>(S __u3); 986 typedef Iterable<T> __t2<S, T>(S __u3);
991 typedef Iterable<dynamic> __t4(dynamic __u5); 987 typedef Iterable<dynamic> __t4(dynamic __u5);
992 typedef bool __t9<E>(E __u10); 988 typedef bool __t8<E>(E __u9);
993 typedef bool __t11(dynamic __u12); 989 typedef bool __t10(dynamic __u11);
994 typedef bool __t14<E>(E __u15); 990 typedef bool __t13<E>(E __u14);
995 typedef bool __t18<T>(T __u19); 991 typedef bool __t16<T>(T __u17);
OLDNEW
« no previous file with comments | « test/codegen/expect/server_mode/html_input.html ('k') | test/dart_codegen/expect/async/broadcast_stream_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698