| library; |
| import self as self; |
| import "dart:core" as core; |
| import "dart:collection" as col; |
| import "dart:math" as math; |
| |
| import "dart:collection"; |
| |
| abstract class _MyList&Object&ListMixin<E extends core::Object? = dynamic> = core::Object with col::ListBase<self::_MyList&Object&ListMixin::E%> /*isAnonymousMixin,hasConstConstructor*/ { |
| const synthetic constructor •() → self::_MyList&Object&ListMixin<self::_MyList&Object&ListMixin::E%> |
| : super core::Object::•() |
| ; |
| mixin-super-stub get first() → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::first}; |
| mixin-super-stub set first(covariant-by-class self::_MyList&Object&ListMixin::E% value) → void |
| return super.{col::ListBase::first} = value; |
| mixin-super-stub get last() → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::last}; |
| mixin-super-stub set last(covariant-by-class self::_MyList&Object&ListMixin::E% value) → void |
| return super.{col::ListBase::last} = value; |
| mixin-super-stub get iterator() → core::Iterator<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::iterator}; |
| mixin-super-stub method elementAt(core::int index) → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::elementAt}(index); |
| mixin-super-stub method followedBy(covariant-by-class core::Iterable<self::_MyList&Object&ListMixin::E%> other) → core::Iterable<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::followedBy}(other); |
| mixin-super-stub method forEach((self::_MyList&Object&ListMixin::E%) → void action) → void |
| return super.{col::ListBase::forEach}(action); |
| mixin-super-stub get isEmpty() → core::bool |
| return super.{col::ListBase::isEmpty}; |
| mixin-super-stub get isNotEmpty() → core::bool |
| return super.{col::ListBase::isNotEmpty}; |
| mixin-super-stub get single() → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::single}; |
| mixin-super-stub method contains(core::Object? element) → core::bool |
| return super.{col::ListBase::contains}(element); |
| mixin-super-stub method every((self::_MyList&Object&ListMixin::E%) → core::bool test) → core::bool |
| return super.{col::ListBase::every}(test); |
| mixin-super-stub method any((self::_MyList&Object&ListMixin::E%) → core::bool test) → core::bool |
| return super.{col::ListBase::any}(test); |
| mixin-super-stub method firstWhere((self::_MyList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_MyList&Object&ListMixin::E% orElse = #C1}) → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::firstWhere}(test, orElse: orElse); |
| mixin-super-stub method lastWhere((self::_MyList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_MyList&Object&ListMixin::E% orElse = #C1}) → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::lastWhere}(test, orElse: orElse); |
| mixin-super-stub method singleWhere((self::_MyList&Object&ListMixin::E%) → core::bool test, {covariant-by-class () →? self::_MyList&Object&ListMixin::E% orElse = #C1}) → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::singleWhere}(test, orElse: orElse); |
| mixin-super-stub method join([core::String separator = #C2]) → core::String |
| return super.{col::ListBase::join}(separator); |
| mixin-super-stub method where((self::_MyList&Object&ListMixin::E%) → core::bool test) → core::Iterable<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::where}(test); |
| mixin-super-stub method whereType<T extends core::Object? = dynamic>() → core::Iterable<self::_MyList&Object&ListMixin::whereType::T%> |
| return super.{col::ListBase::whereType}<self::_MyList&Object&ListMixin::whereType::T%>(); |
| mixin-super-stub method map<T extends core::Object? = dynamic>((self::_MyList&Object&ListMixin::E%) → self::_MyList&Object&ListMixin::map::T% f) → core::Iterable<self::_MyList&Object&ListMixin::map::T%> |
| return super.{col::ListBase::map}<self::_MyList&Object&ListMixin::map::T%>(f); |
| mixin-super-stub method expand<T extends core::Object? = dynamic>((self::_MyList&Object&ListMixin::E%) → core::Iterable<self::_MyList&Object&ListMixin::expand::T%> f) → core::Iterable<self::_MyList&Object&ListMixin::expand::T%> |
| return super.{col::ListBase::expand}<self::_MyList&Object&ListMixin::expand::T%>(f); |
| mixin-super-stub method reduce(covariant-by-class (self::_MyList&Object&ListMixin::E%, self::_MyList&Object&ListMixin::E%) → self::_MyList&Object&ListMixin::E% combine) → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::reduce}(combine); |
| mixin-super-stub method fold<T extends core::Object? = dynamic>(self::_MyList&Object&ListMixin::fold::T% initialValue, (self::_MyList&Object&ListMixin::fold::T%, self::_MyList&Object&ListMixin::E%) → self::_MyList&Object&ListMixin::fold::T% combine) → self::_MyList&Object&ListMixin::fold::T% |
| return super.{col::ListBase::fold}<self::_MyList&Object&ListMixin::fold::T%>(initialValue, combine); |
| mixin-super-stub method skip(core::int count) → core::Iterable<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::skip}(count); |
| mixin-super-stub method skipWhile((self::_MyList&Object&ListMixin::E%) → core::bool test) → core::Iterable<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::skipWhile}(test); |
| mixin-super-stub method take(core::int count) → core::Iterable<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::take}(count); |
| mixin-super-stub method takeWhile((self::_MyList&Object&ListMixin::E%) → core::bool test) → core::Iterable<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::takeWhile}(test); |
| mixin-super-stub method toList({core::bool growable = #C3}) → core::List<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::toList}(growable: growable); |
| mixin-super-stub method toSet() → core::Set<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::toSet}(); |
| mixin-super-stub method add(covariant-by-class self::_MyList&Object&ListMixin::E% element) → void |
| return super.{col::ListBase::add}(element); |
| mixin-super-stub method addAll(covariant-by-class core::Iterable<self::_MyList&Object&ListMixin::E%> iterable) → void |
| return super.{col::ListBase::addAll}(iterable); |
| mixin-super-stub method remove(core::Object? element) → core::bool |
| return super.{col::ListBase::remove}(element); |
| mixin-super-stub method _closeGap(core::int start, core::int end) → void |
| return super.{col::ListBase::_closeGap}(start, end); |
| mixin-super-stub method removeWhere((self::_MyList&Object&ListMixin::E%) → core::bool test) → void |
| return super.{col::ListBase::removeWhere}(test); |
| mixin-super-stub method retainWhere((self::_MyList&Object&ListMixin::E%) → core::bool test) → void |
| return super.{col::ListBase::retainWhere}(test); |
| mixin-super-stub method _filter((self::_MyList&Object&ListMixin::E%) → core::bool test, core::bool retainMatching) → void |
| return super.{col::ListBase::_filter}(test, retainMatching); |
| mixin-super-stub method clear() → void |
| return super.{col::ListBase::clear}(); |
| mixin-super-stub method cast<R extends core::Object? = dynamic>() → core::List<self::_MyList&Object&ListMixin::cast::R%> |
| return super.{col::ListBase::cast}<self::_MyList&Object&ListMixin::cast::R%>(); |
| mixin-super-stub method removeLast() → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::removeLast}(); |
| mixin-super-stub method sort([(self::_MyList&Object&ListMixin::E%, self::_MyList&Object&ListMixin::E%) →? core::int compare = #C1]) → void |
| return super.{col::ListBase::sort}(compare); |
| mixin-super-stub method shuffle([math::Random? random = #C1]) → void |
| return super.{col::ListBase::shuffle}(random); |
| mixin-super-stub method asMap() → core::Map<core::int, self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::asMap}(); |
| mixin-super-stub operator +(covariant-by-class core::List<self::_MyList&Object&ListMixin::E%> other) → core::List<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::+}(other); |
| mixin-super-stub method sublist(core::int start, [core::int? end = #C1]) → core::List<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::sublist}(start, end); |
| mixin-super-stub method getRange(core::int start, core::int end) → core::Iterable<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::getRange}(start, end); |
| mixin-super-stub method removeRange(core::int start, core::int end) → void |
| return super.{col::ListBase::removeRange}(start, end); |
| mixin-super-stub method fillRange(core::int start, core::int end, [covariant-by-class self::_MyList&Object&ListMixin::E? fill = #C1]) → void |
| return super.{col::ListBase::fillRange}(start, end, fill); |
| mixin-super-stub method setRange(core::int start, core::int end, covariant-by-class core::Iterable<self::_MyList&Object&ListMixin::E%> iterable, [core::int skipCount = #C4]) → void |
| return super.{col::ListBase::setRange}(start, end, iterable, skipCount); |
| mixin-super-stub method replaceRange(core::int start, core::int end, covariant-by-class core::Iterable<self::_MyList&Object&ListMixin::E%> newContents) → void |
| return super.{col::ListBase::replaceRange}(start, end, newContents); |
| mixin-super-stub method indexOf(covariant-by-class core::Object? element, [core::int start = #C4]) → core::int |
| return super.{col::ListBase::indexOf}(element, start); |
| mixin-super-stub method indexWhere((self::_MyList&Object&ListMixin::E%) → core::bool test, [core::int start = #C4]) → core::int |
| return super.{col::ListBase::indexWhere}(test, start); |
| mixin-super-stub method lastIndexOf(covariant-by-class core::Object? element, [core::int? start = #C1]) → core::int |
| return super.{col::ListBase::lastIndexOf}(element, start); |
| mixin-super-stub method lastIndexWhere((self::_MyList&Object&ListMixin::E%) → core::bool test, [core::int? start = #C1]) → core::int |
| return super.{col::ListBase::lastIndexWhere}(test, start); |
| mixin-super-stub method insert(core::int index, covariant-by-class self::_MyList&Object&ListMixin::E% element) → void |
| return super.{col::ListBase::insert}(index, element); |
| mixin-super-stub method removeAt(core::int index) → self::_MyList&Object&ListMixin::E% |
| return super.{col::ListBase::removeAt}(index); |
| mixin-super-stub method insertAll(core::int index, covariant-by-class core::Iterable<self::_MyList&Object&ListMixin::E%> iterable) → void |
| return super.{col::ListBase::insertAll}(index, iterable); |
| mixin-super-stub method setAll(core::int index, covariant-by-class core::Iterable<self::_MyList&Object&ListMixin::E%> iterable) → void |
| return super.{col::ListBase::setAll}(index, iterable); |
| mixin-super-stub get reversed() → core::Iterable<self::_MyList&Object&ListMixin::E%> |
| return super.{col::ListBase::reversed}; |
| mixin-super-stub method toString() → core::String |
| return super.{col::ListBase::toString}(); |
| } |
| class MyList<E extends core::Object? = dynamic> extends self::_MyList&Object&ListMixin<self::MyList::E%> { |
| final field core::List<self::MyList::E%> list; |
| field core::StringBuffer sb = new core::StringBuffer::•(); |
| constructor •(core::List<self::MyList::E%> list) → self::MyList<self::MyList::E%> |
| : self::MyList::list = list, super self::_MyList&Object&ListMixin::•() |
| ; |
| operator [](core::int index) → self::MyList::E% { |
| this.{self::MyList::sb}{core::StringBuffer}.{core::StringBuffer::write}("[${index}];"){(core::Object?) → void}; |
| return this.{self::MyList::list}{core::List<self::MyList::E%>}.{core::List::[]}(index){(core::int) → self::MyList::E%}; |
| } |
| operator []=(core::int index, covariant-by-class self::MyList::E% value) → void { |
| this.{self::MyList::list}{core::List<self::MyList::E%>}.{core::List::[]=}(index, value){(core::int, self::MyList::E%) → void}; |
| } |
| get length() → core::int |
| return this.{self::MyList::list}{core::List<self::MyList::E%>}.{core::List::length}{core::int}; |
| set length(core::int value) → void { |
| this.{self::MyList::list}{core::List<self::MyList::E%>}.{core::List::length} = value; |
| } |
| get log() → core::String |
| return this.{self::MyList::sb}{core::StringBuffer}.{core::StringBuffer::toString}(){() → core::String}; |
| method clearLog() → void { |
| this.{self::MyList::sb}{core::StringBuffer}.{core::StringBuffer::clear}(){() → void}; |
| } |
| } |
| static method test1(core::Object o) → core::String |
| return block { |
| core::String #t1; |
| final synthesized core::Object #0#0 = o; |
| #L1: |
| { |
| { |
| hoisted core::Object? x; |
| hoisted core::Object? y; |
| if(#0#0 is core::List<core::Object?> && #0#0{core::List<core::Object?>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C5 && (let final dynamic #t2 = x = #0#0{core::List<core::Object?>}.{core::List::[]}(0){(core::int) → core::Object?} in true) && #C6 =={core::num::==}{(core::Object) → core::bool} #0#0{core::List<core::Object?>}.{core::List::[]}(1){(core::int) → core::Object?}) { |
| y = #0#0{core::List<core::Object?>}.{core::List::[]}(2){(core::int) → core::Object?}; |
| #t1 = "match-1"; |
| break #L1; |
| } |
| } |
| { |
| if(true) { |
| #t1 = "no match"; |
| break #L1; |
| } |
| } |
| } |
| } =>#t1; |
| static method test2(core::Object o) → core::String |
| return block { |
| core::String #t3; |
| final synthesized core::Object #0#0 = o; |
| #L2: |
| { |
| { |
| hoisted core::Object? x; |
| hoisted core::Object? y; |
| if(#0#0 is core::List<core::Object?> && #0#0{core::List<core::Object?>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C5 && #C7 =={core::num::==}{(core::Object) → core::bool} #0#0{core::List<core::Object?>}.{core::List::[]}(0){(core::int) → core::Object?}) { |
| x = #0#0{core::List<core::Object?>}.{core::List::[]}(1){(core::int) → core::Object?}; |
| y = #0#0{core::List<core::Object?>}.{core::List::[]}(2){(core::int) → core::Object?}; |
| #t3 = "match-1"; |
| break #L2; |
| } |
| } |
| { |
| if(true) { |
| #t3 = "no match"; |
| break #L2; |
| } |
| } |
| } |
| } =>#t3; |
| static method test3(core::Object o) → core::String |
| return block { |
| core::String #t4; |
| final synthesized core::Object #0#0 = o; |
| synthesized core::bool #0#4; |
| synthesized core::bool #0#4#isSet = false; |
| synthesized core::Object? #0#6; |
| synthesized core::bool #0#6#isSet = false; |
| synthesized core::Object? #0#8; |
| synthesized core::bool #0#8#isSet = false; |
| #L3: |
| { |
| { |
| hoisted core::Object x; |
| if(#0#0 is core::List<core::Object?> && (#0#4#isSet ?{core::bool} #0#4{core::bool} : let final dynamic #t5 = #0#4#isSet = true in #0#4 = #0#0{core::List<core::Object?>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C6) && (let final dynamic #t6 = (#0#6#isSet ?{core::Object?} #0#6{core::Object?} : let final dynamic #t7 = #0#6#isSet = true in #0#6 = #0#0{core::List<core::Object?>}.{core::List::[]}(0){(core::int) → core::Object?})! in let final dynamic #t8 = x = (#0#6#isSet ?{core::Object?} #0#6{core::Object?} : let final dynamic #t9 = #0#6#isSet = true in #0#6 = #0#0{core::List<core::Object?>}.{core::List::[]}(0){(core::int) → core::Object?})! in true) && #C7 =={core::num::==}{(core::Object) → core::bool} (#0#8#isSet ?{core::Object?} #0#8{core::Object?} : let final dynamic #t10 = #0#8#isSet = true in #0#8 = #0#0{core::List<core::Object?>}.{core::List::[]}(1){(core::int) → core::Object?})) { |
| #t4 = "match-1"; |
| break #L3; |
| } |
| } |
| { |
| hoisted core::Object x; |
| if(#0#0 is core::List<core::Object?> && (#0#4#isSet ?{core::bool} #0#4{core::bool} : let final dynamic #t11 = #0#4#isSet = true in #0#4 = #0#0{core::List<core::Object?>}.{core::List::length}{core::int} =={core::num::==}{(core::Object) → core::bool} #C6) && #C7 =={core::num::==}{(core::Object) → core::bool} (#0#6#isSet ?{core::Object?} #0#6{core::Object?} : let final dynamic #t12 = #0#6#isSet = true in #0#6 = #0#0{core::List<core::Object?>}.{core::List::[]}(0){(core::int) → core::Object?})) { |
| (#0#8#isSet ?{core::Object?} #0#8{core::Object?} : let final dynamic #t13 = #0#8#isSet = true in #0#8 = #0#0{core::List<core::Object?>}.{core::List::[]}(1){(core::int) → core::Object?})!; |
| x = (#0#8#isSet ?{core::Object?} #0#8{core::Object?} : let final dynamic #t14 = #0#8#isSet = true in #0#8 = #0#0{core::List<core::Object?>}.{core::List::[]}(1){(core::int) → core::Object?})!; |
| #t4 = "match-2"; |
| break #L3; |
| } |
| } |
| { |
| if(true) { |
| #t4 = "no match"; |
| break #L3; |
| } |
| } |
| } |
| } =>#t4; |
| static method main() → dynamic { |
| final self::MyList<core::int> ml1 = new self::MyList::•<core::int>(<core::int>[1, 2, 3]); |
| self::expect("match-1", self::test1(ml1)); |
| self::expect("[0];[1];[2];", ml1.{self::MyList::log}{core::String}); |
| final self::MyList<core::int> ml2 = new self::MyList::•<core::int>(<core::int>[1, 2, 3]); |
| self::expect("match-1", self::test2(ml2)); |
| self::expect("[0];[1];[2];", ml2.{self::MyList::log}{core::String}); |
| final self::MyList<core::int> ml3 = new self::MyList::•<core::int>(<core::int>[1, 2]); |
| self::expect("match-2", self::test3(ml3)); |
| self::expect("[0];[1];", ml3.{self::MyList::log}{core::String}); |
| } |
| static method expect(dynamic expected, dynamic actual) → dynamic { |
| if(!(expected =={core::Object::==}{(core::Object) → core::bool} actual)) |
| throw "Expected ${expected}, actual ${actual}"; |
| } |
| |
| constants { |
| #C1 = null |
| #C2 = "" |
| #C3 = true |
| #C4 = 0 |
| #C5 = 3 |
| #C6 = 2 |
| #C7 = 1 |
| } |