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

Side by Side Diff: test/dart_codegen/expect/collection/splay_tree.dart

Issue 1010893004: Allow S->T <: dynamic->T (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase and address comments 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 unified diff | Download patch
OLDNEW
1 part of dart.collection; 1 part of dart.collection;
2 typedef bool _Predicate<T>(T value); 2 typedef bool _Predicate<T>(T value);
3 class _SplayTreeNode<K> {final K key; 3 class _SplayTreeNode<K> {final K key;
4 _SplayTreeNode<K> left; 4 _SplayTreeNode<K> left;
5 _SplayTreeNode<K> right; 5 _SplayTreeNode<K> right;
6 _SplayTreeNode(K this.key); 6 _SplayTreeNode(K this.key);
7 } 7 }
8 class _SplayTreeMapNode<K, V> extends _SplayTreeNode<K> {V value; 8 class _SplayTreeMapNode<K, V> extends _SplayTreeNode<K> {V value;
9 _SplayTreeMapNode(K key, V this.value) : super(key); 9 _SplayTreeMapNode(K key, V this.value) : super(key);
10 } 10 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 void _clear() { 140 void _clear() {
141 _root = null; 141 _root = null;
142 _count = 0; 142 _count = 0;
143 _modificationCount++; 143 _modificationCount++;
144 } 144 }
145 } 145 }
146 class _TypeTest<T> {bool test(v) => v is T; 146 class _TypeTest<T> {bool test(v) => v is T;
147 } 147 }
148 class SplayTreeMap<K, V> extends _SplayTree<K> implements Map<K, V> {Comparator <K> _comparator; 148 class SplayTreeMap<K, V> extends _SplayTree<K> implements Map<K, V> {Comparator <K> _comparator;
149 _Predicate _validKey; 149 _Predicate _validKey;
150 SplayTreeMap([int compare(K key1, K key2), bool isValidKey(potentialKey)]) : _c omparator = ((__x36) => DEVC$RT.cast(__x36, dynamic, DEVC$RT.type((__t33<K> _) { 150 SplayTreeMap([int compare(K key1, K key2), bool isValidKey(potentialKey)]) : _c omparator = ((__x23) => DEVC$RT.cast(__x23, dynamic, DEVC$RT.type((__t20<K> _) {
151 } 151 }
152 ), "CastGeneral", """line 268, column 23 of dart:collection/splay_tree.dart: """ , __x36 is __t33<K>, false))((compare == null) ? Comparable.compare : compare), _validKey = ((__x39) => DEVC$RT.cast(__x39, dynamic, __t37, "CastGeneral", """li ne 269, column 21 of dart:collection/splay_tree.dart: """, __x39 is __t37, false ))((isValidKey != null) ? isValidKey : ((v) => v is K)); 152 ), "CastGeneral", """line 268, column 23 of dart:collection/splay_tree.dart: """ , __x23 is __t20<K>, false))((compare == null) ? Comparable.compare : compare), _validKey = ((__x26) => DEVC$RT.cast(__x26, dynamic, __t24, "CastGeneral", """li ne 269, column 21 of dart:collection/splay_tree.dart: """, __x26 is __t24, false ))((isValidKey != null) ? isValidKey : ((v) => v is K));
153 factory SplayTreeMap.from(Map other, [int compare(K key1, K key2), bool isValid Key(potentialKey)]) { 153 factory SplayTreeMap.from(Map other, [int compare(K key1, K key2), bool isValid Key(potentialKey)]) {
154 SplayTreeMap<K, V> result = new SplayTreeMap<K, V>(); 154 SplayTreeMap<K, V> result = new SplayTreeMap<K, V>();
155 other.forEach((k, v) { 155 other.forEach((k, v) {
156 result[k] = DEVC$RT.cast(v, dynamic, V, "CastGeneral", """line 278, column 40 of dart:collection/splay_tree.dart: """, v is V, false); 156 result[k] = DEVC$RT.cast(v, dynamic, V, "CastGeneral", """line 278, column 40 of dart:collection/splay_tree.dart: """, v is V, false);
157 } 157 }
158 ); 158 );
159 return result; 159 return result;
160 } 160 }
161 factory SplayTreeMap.fromIterable(Iterable iterable, { 161 factory SplayTreeMap.fromIterable(Iterable iterable, {
162 K key(element), V value(element), int compare(K key1, K key2), bool isValidKey(p otentialKey)} 162 K key(element), V value(element), int compare(K key1, K key2), bool isValidKey(p otentialKey)}
(...skipping 20 matching lines...) Expand all
183 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) { 183 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) {
184 } 184 }
185 ), "CastGeneral", """line 333, column 37 of dart:collection/splay_tree.dart: """ , _root is _SplayTreeMapNode<dynamic, dynamic>, true); 185 ), "CastGeneral", """line 333, column 37 of dart:collection/splay_tree.dart: """ , _root is _SplayTreeMapNode<dynamic, dynamic>, true);
186 return DEVC$RT.cast(mapRoot.value, dynamic, V, "CastGeneral", """line 334, colu mn 16 of dart:collection/splay_tree.dart: """, mapRoot.value is V, false); 186 return DEVC$RT.cast(mapRoot.value, dynamic, V, "CastGeneral", """line 334, colu mn 16 of dart:collection/splay_tree.dart: """, mapRoot.value is V, false);
187 } 187 }
188 } 188 }
189 return null; 189 return null;
190 } 190 }
191 V remove(Object key) { 191 V remove(Object key) {
192 if (!_validKey(key)) return null; 192 if (!_validKey(key)) return null;
193 _SplayTreeMapNode mapRoot = ((__x40) => DEVC$RT.cast(__x40, DEVC$RT.type((_Spla yTreeNode<dynamic> _) { 193 _SplayTreeMapNode mapRoot = ((__x27) => DEVC$RT.cast(__x27, DEVC$RT.type((_Spla yTreeNode<dynamic> _) {
194 } 194 }
195 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) { 195 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) {
196 } 196 }
197 ), "CastGeneral", """line 342, column 33 of dart:collection/splay_tree.dart: """ , __x40 is _SplayTreeMapNode<dynamic, dynamic>, true))(_remove(DEVC$RT.cast(key, Object, K, "CastGeneral", """line 342, column 41 of dart:collection/splay_tree. dart: """, key is K, false))); 197 ), "CastGeneral", """line 342, column 33 of dart:collection/splay_tree.dart: """ , __x27 is _SplayTreeMapNode<dynamic, dynamic>, true))(_remove(DEVC$RT.cast(key, Object, K, "CastGeneral", """line 342, column 41 of dart:collection/splay_tree. dart: """, key is K, false)));
198 if (mapRoot != null) return DEVC$RT.cast(mapRoot.value, dynamic, V, "CastGenera l", """line 343, column 33 of dart:collection/splay_tree.dart: """, mapRoot.valu e is V, false); 198 if (mapRoot != null) return DEVC$RT.cast(mapRoot.value, dynamic, V, "CastGenera l", """line 343, column 33 of dart:collection/splay_tree.dart: """, mapRoot.valu e is V, false);
199 return null; 199 return null;
200 } 200 }
201 void operator []=(K key, V value) { 201 void operator []=(K key, V value) {
202 if (key == null) throw new ArgumentError(key); 202 if (key == null) throw new ArgumentError(key);
203 int comp = _splay(key); 203 int comp = _splay(key);
204 if (comp == 0) { 204 if (comp == 0) {
205 _SplayTreeMapNode mapRoot = DEVC$RT.cast(_root, DEVC$RT.type((_SplayTreeNode<K> _) { 205 _SplayTreeMapNode mapRoot = DEVC$RT.cast(_root, DEVC$RT.type((_SplayTreeNode<K> _) {
206 } 206 }
207 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) { 207 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) {
208 } 208 }
209 ), "CastGeneral", """line 353, column 35 of dart:collection/splay_tree.dart: """ , _root is _SplayTreeMapNode<dynamic, dynamic>, true); 209 ), "CastGeneral", """line 353, column 35 of dart:collection/splay_tree.dart: """ , _root is _SplayTreeMapNode<dynamic, dynamic>, true);
210 mapRoot.value = value; 210 mapRoot.value = value;
211 return;} 211 return;}
212 _addNewRoot(((__x41) => DEVC$RT.cast(__x41, DEVC$RT.type((_SplayTreeMapNode<dyn amic, dynamic> _) { 212 _addNewRoot(((__x28) => DEVC$RT.cast(__x28, DEVC$RT.type((_SplayTreeMapNode<dyn amic, dynamic> _) {
213 } 213 }
214 ), DEVC$RT.type((_SplayTreeNode<K> _) { 214 ), DEVC$RT.type((_SplayTreeNode<K> _) {
215 } 215 }
216 ), "CastExact", """line 357, column 17 of dart:collection/splay_tree.dart: """, __x41 is _SplayTreeNode<K>, false))(new _SplayTreeMapNode(key, value)), comp); 216 ), "CastExact", """line 357, column 17 of dart:collection/splay_tree.dart: """, __x28 is _SplayTreeNode<K>, false))(new _SplayTreeMapNode(key, value)), comp);
217 } 217 }
218 V putIfAbsent(K key, V ifAbsent()) { 218 V putIfAbsent(K key, V ifAbsent()) {
219 if (key == null) throw new ArgumentError(key); 219 if (key == null) throw new ArgumentError(key);
220 int comp = _splay(key); 220 int comp = _splay(key);
221 if (comp == 0) { 221 if (comp == 0) {
222 _SplayTreeMapNode mapRoot = DEVC$RT.cast(_root, DEVC$RT.type((_SplayTreeNode<K> _) { 222 _SplayTreeMapNode mapRoot = DEVC$RT.cast(_root, DEVC$RT.type((_SplayTreeNode<K> _) {
223 } 223 }
224 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) { 224 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) {
225 } 225 }
226 ), "CastGeneral", """line 365, column 35 of dart:collection/splay_tree.dart: """ , _root is _SplayTreeMapNode<dynamic, dynamic>, true); 226 ), "CastGeneral", """line 365, column 35 of dart:collection/splay_tree.dart: """ , _root is _SplayTreeMapNode<dynamic, dynamic>, true);
227 return DEVC$RT.cast(mapRoot.value, dynamic, V, "CastGeneral", """line 366, colu mn 14 of dart:collection/splay_tree.dart: """, mapRoot.value is V, false); 227 return DEVC$RT.cast(mapRoot.value, dynamic, V, "CastGeneral", """line 366, colu mn 14 of dart:collection/splay_tree.dart: """, mapRoot.value is V, false);
228 } 228 }
229 int modificationCount = _modificationCount; 229 int modificationCount = _modificationCount;
230 int splayCount = _splayCount; 230 int splayCount = _splayCount;
231 V value = ifAbsent(); 231 V value = ifAbsent();
232 if (modificationCount != _modificationCount) { 232 if (modificationCount != _modificationCount) {
233 throw new ConcurrentModificationError(this); 233 throw new ConcurrentModificationError(this);
234 } 234 }
235 if (splayCount != _splayCount) { 235 if (splayCount != _splayCount) {
236 comp = _splay(key); 236 comp = _splay(key);
237 assert (comp != 0);} 237 assert (comp != 0);}
238 _addNewRoot(((__x42) => DEVC$RT.cast(__x42, DEVC$RT.type((_SplayTreeMapNode<dyn amic, dynamic> _) { 238 _addNewRoot(((__x29) => DEVC$RT.cast(__x29, DEVC$RT.type((_SplayTreeMapNode<dyn amic, dynamic> _) {
239 } 239 }
240 ), DEVC$RT.type((_SplayTreeNode<K> _) { 240 ), DEVC$RT.type((_SplayTreeNode<K> _) {
241 } 241 }
242 ), "CastExact", """line 379, column 17 of dart:collection/splay_tree.dart: """, __x42 is _SplayTreeNode<K>, false))(new _SplayTreeMapNode(key, value)), comp); 242 ), "CastExact", """line 379, column 17 of dart:collection/splay_tree.dart: """, __x29 is _SplayTreeNode<K>, false))(new _SplayTreeMapNode(key, value)), comp);
243 return value; 243 return value;
244 } 244 }
245 void addAll(Map<K, V> other) { 245 void addAll(Map<K, V> other) {
246 other.forEach((K key, V value) { 246 other.forEach((K key, V value) {
247 this[key] = value; 247 this[key] = value;
248 } 248 }
249 ); 249 );
250 } 250 }
251 bool get isEmpty { 251 bool get isEmpty {
252 return (_root == null); 252 return (_root == null);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 393 }
394 T _getValue(_SplayTreeNode node); 394 T _getValue(_SplayTreeNode node);
395 } 395 }
396 class _SplayTreeKeyIterable<K> extends IterableBase<K> implements EfficientLeng th {_SplayTree<K> _tree; 396 class _SplayTreeKeyIterable<K> extends IterableBase<K> implements EfficientLeng th {_SplayTree<K> _tree;
397 _SplayTreeKeyIterable(this._tree); 397 _SplayTreeKeyIterable(this._tree);
398 int get length => _tree._count; 398 int get length => _tree._count;
399 bool get isEmpty => _tree._count == 0; 399 bool get isEmpty => _tree._count == 0;
400 Iterator<K> get iterator => new _SplayTreeKeyIterator<K>(_tree); 400 Iterator<K> get iterator => new _SplayTreeKeyIterator<K>(_tree);
401 Set<K> toSet() { 401 Set<K> toSet() {
402 var setOrMap = _tree; 402 var setOrMap = _tree;
403 SplayTreeSet<K> set = new SplayTreeSet<K>(DEVC$RT.cast(setOrMap._comparator, dy namic, DEVC$RT.type((__t43<K> _) { 403 SplayTreeSet<K> set = new SplayTreeSet<K>(DEVC$RT.cast(setOrMap._comparator, dy namic, DEVC$RT.type((__t30<K> _) {
404 } 404 }
405 ), "CastGeneral", """line 613, column 29 of dart:collection/splay_tree.dart: """ , setOrMap._comparator is __t43<K>, false), DEVC$RT.cast(setOrMap._validKey, dyn amic, __t37, "CastGeneral", """line 613, column 51 of dart:collection/splay_tree .dart: """, setOrMap._validKey is __t37, false)); 405 ), "CastGeneral", """line 613, column 29 of dart:collection/splay_tree.dart: """ , setOrMap._comparator is __t30<K>, false), DEVC$RT.cast(setOrMap._validKey, dyn amic, __t24, "CastGeneral", """line 613, column 51 of dart:collection/splay_tree .dart: """, setOrMap._validKey is __t24, false));
406 set._count = _tree._count; 406 set._count = _tree._count;
407 set._root = set._copyNode(_tree._root); 407 set._root = set._copyNode(_tree._root);
408 return set; 408 return set;
409 } 409 }
410 } 410 }
411 class _SplayTreeValueIterable<K, V> extends IterableBase<V> implements Efficien tLength {SplayTreeMap<K, V> _map; 411 class _SplayTreeValueIterable<K, V> extends IterableBase<V> implements Efficien tLength {SplayTreeMap<K, V> _map;
412 _SplayTreeValueIterable(this._map); 412 _SplayTreeValueIterable(this._map);
413 int get length => _map._count; 413 int get length => _map._count;
414 bool get isEmpty => _map._count == 0; 414 bool get isEmpty => _map._count == 0;
415 Iterator<V> get iterator => new _SplayTreeValueIterator<K, V>(_map); 415 Iterator<V> get iterator => new _SplayTreeValueIterator<K, V>(_map);
416 } 416 }
417 class _SplayTreeKeyIterator<K> extends _SplayTreeIterator<K> {_SplayTreeKeyIter ator(_SplayTree<K> map) : super(map); 417 class _SplayTreeKeyIterator<K> extends _SplayTreeIterator<K> {_SplayTreeKeyIter ator(_SplayTree<K> map) : super(map);
418 K _getValue(_SplayTreeNode node) => DEVC$RT.cast(node.key, dynamic, K, "CastGen eral", """line 631, column 39 of dart:collection/splay_tree.dart: """, node.key is K, false); 418 K _getValue(_SplayTreeNode node) => DEVC$RT.cast(node.key, dynamic, K, "CastGen eral", """line 631, column 39 of dart:collection/splay_tree.dart: """, node.key is K, false);
419 } 419 }
420 class _SplayTreeValueIterator<K, V> extends _SplayTreeIterator<V> {_SplayTreeVa lueIterator(SplayTreeMap<K, V> map) : super(map); 420 class _SplayTreeValueIterator<K, V> extends _SplayTreeIterator<V> {_SplayTreeVa lueIterator(SplayTreeMap<K, V> map) : super(map);
421 V _getValue(_SplayTreeMapNode node) => DEVC$RT.cast(node.value, dynamic, V, "Ca stGeneral", """line 636, column 42 of dart:collection/splay_tree.dart: """, node .value is V, false); 421 V _getValue(_SplayTreeMapNode node) => DEVC$RT.cast(node.value, dynamic, V, "Ca stGeneral", """line 636, column 42 of dart:collection/splay_tree.dart: """, node .value is V, false);
422 } 422 }
423 class _SplayTreeNodeIterator<K> extends _SplayTreeIterator<_SplayTreeNode<K>> { _SplayTreeNodeIterator(_SplayTree<K> tree) : super(tree); 423 class _SplayTreeNodeIterator<K> extends _SplayTreeIterator<_SplayTreeNode<K>> { _SplayTreeNodeIterator(_SplayTree<K> tree) : super(tree);
424 _SplayTreeNodeIterator.startAt(_SplayTree<K> tree, var startKey) : super.startA t(tree, startKey); 424 _SplayTreeNodeIterator.startAt(_SplayTree<K> tree, var startKey) : super.startA t(tree, startKey);
425 _SplayTreeNode<K> _getValue(_SplayTreeNode node) => DEVC$RT.cast(node, DEVC$RT. type((_SplayTreeNode<dynamic> _) { 425 _SplayTreeNode<K> _getValue(_SplayTreeNode node) => DEVC$RT.cast(node, DEVC$RT. type((_SplayTreeNode<dynamic> _) {
426 } 426 }
427 ), DEVC$RT.type((_SplayTreeNode<K> _) { 427 ), DEVC$RT.type((_SplayTreeNode<K> _) {
428 } 428 }
429 ), "CastDynamic", """line 644, column 55 of dart:collection/splay_tree.dart: """ , node is _SplayTreeNode<K>, false); 429 ), "CastDynamic", """line 644, column 55 of dart:collection/splay_tree.dart: """ , node is _SplayTreeNode<K>, false);
430 } 430 }
431 class SplayTreeSet<E> extends _SplayTree<E> with IterableMixin<E>, SetMixin<E> {Comparator _comparator; 431 class SplayTreeSet<E> extends _SplayTree<E> with IterableMixin<E>, SetMixin<E> {Comparator _comparator;
432 _Predicate _validKey; 432 _Predicate _validKey;
433 SplayTreeSet([int compare(E key1, E key2), bool isValidKey(potentialKey)]) : _c omparator = ((__x49) => DEVC$RT.cast(__x49, dynamic, __t46, "CastGeneral", """li ne 693, column 23 of dart:collection/splay_tree.dart: """, __x49 is __t46, false ))((compare == null) ? Comparable.compare : compare), _validKey = ((__x50) => DE VC$RT.cast(__x50, dynamic, __t37, "CastGeneral", """line 694, column 21 of dart: collection/splay_tree.dart: """, __x50 is __t37, false))((isValidKey != null) ? isValidKey : ((v) => v is E)); 433 SplayTreeSet([int compare(E key1, E key2), bool isValidKey(potentialKey)]) : _c omparator = ((__x36) => DEVC$RT.cast(__x36, dynamic, __t33, "CastGeneral", """li ne 693, column 23 of dart:collection/splay_tree.dart: """, __x36 is __t33, false ))((compare == null) ? Comparable.compare : compare), _validKey = ((__x37) => DE VC$RT.cast(__x37, dynamic, __t24, "CastGeneral", """line 694, column 21 of dart: collection/splay_tree.dart: """, __x37 is __t24, false))((isValidKey != null) ? isValidKey : ((v) => v is E));
434 factory SplayTreeSet.from(Iterable elements, [int compare(E key1, E key2), bool isValidKey(potentialKey)]) { 434 factory SplayTreeSet.from(Iterable elements, [int compare(E key1, E key2), bool isValidKey(potentialKey)]) {
435 SplayTreeSet<E> result = new SplayTreeSet<E>(compare, isValidKey); 435 SplayTreeSet<E> result = new SplayTreeSet<E>(compare, isValidKey);
436 for (final E element in elements) { 436 for (final E element in elements) {
437 result.add(element); 437 result.add(element);
438 } 438 }
439 return result; 439 return result;
440 } 440 }
441 int _compare(E e1, E e2) => _comparator(e1, e2); 441 int _compare(E e1, E e2) => _comparator(e1, e2);
442 Iterator<E> get iterator => new _SplayTreeKeyIterator<E>(this); 442 Iterator<E> get iterator => new _SplayTreeKeyIterator<E>(this);
443 int get length => _count; 443 int get length => _count;
(...skipping 11 matching lines...) Expand all
455 if (_count == 0) throw IterableElementError.noElement(); 455 if (_count == 0) throw IterableElementError.noElement();
456 if (_count > 1) throw IterableElementError.tooMany(); 456 if (_count > 1) throw IterableElementError.tooMany();
457 return _root.key; 457 return _root.key;
458 } 458 }
459 bool contains(Object object) { 459 bool contains(Object object) {
460 return _validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CastGeneral" , """line 741, column 40 of dart:collection/splay_tree.dart: """, object is E, f alse)) == 0; 460 return _validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CastGeneral" , """line 741, column 40 of dart:collection/splay_tree.dart: """, object is E, f alse)) == 0;
461 } 461 }
462 bool add(E element) { 462 bool add(E element) {
463 int compare = _splay(element); 463 int compare = _splay(element);
464 if (compare == 0) return false; 464 if (compare == 0) return false;
465 _addNewRoot(((__x51) => DEVC$RT.cast(__x51, DEVC$RT.type((_SplayTreeNode<dynami c> _) { 465 _addNewRoot(((__x38) => DEVC$RT.cast(__x38, DEVC$RT.type((_SplayTreeNode<dynami c> _) {
466 } 466 }
467 ), DEVC$RT.type((_SplayTreeNode<E> _) { 467 ), DEVC$RT.type((_SplayTreeNode<E> _) {
468 } 468 }
469 ), "CastExact", """line 747, column 17 of dart:collection/splay_tree.dart: """, __x51 is _SplayTreeNode<E>, false))(new _SplayTreeNode(element)), compare); 469 ), "CastExact", """line 747, column 17 of dart:collection/splay_tree.dart: """, __x38 is _SplayTreeNode<E>, false))(new _SplayTreeNode(element)), compare);
470 return true; 470 return true;
471 } 471 }
472 bool remove(Object object) { 472 bool remove(Object object) {
473 if (!_validKey(object)) return false; 473 if (!_validKey(object)) return false;
474 return _remove(DEVC$RT.cast(object, Object, E, "CastGeneral", """line 753, colu mn 20 of dart:collection/splay_tree.dart: """, object is E, false)) != null; 474 return _remove(DEVC$RT.cast(object, Object, E, "CastGeneral", """line 753, colu mn 20 of dart:collection/splay_tree.dart: """, object is E, false)) != null;
475 } 475 }
476 void addAll(Iterable<E> elements) { 476 void addAll(Iterable<E> elements) {
477 for (E element in elements) { 477 for (E element in elements) {
478 int compare = _splay(element); 478 int compare = _splay(element);
479 if (compare != 0) { 479 if (compare != 0) {
480 _addNewRoot(((__x52) => DEVC$RT.cast(__x52, DEVC$RT.type((_SplayTreeNode<dynamic > _) { 480 _addNewRoot(((__x39) => DEVC$RT.cast(__x39, DEVC$RT.type((_SplayTreeNode<dynamic > _) {
481 } 481 }
482 ), DEVC$RT.type((_SplayTreeNode<E> _) { 482 ), DEVC$RT.type((_SplayTreeNode<E> _) {
483 } 483 }
484 ), "CastExact", """line 760, column 21 of dart:collection/splay_tree.dart: """, __x52 is _SplayTreeNode<E>, false))(new _SplayTreeNode(element)), compare); 484 ), "CastExact", """line 760, column 21 of dart:collection/splay_tree.dart: """, __x39 is _SplayTreeNode<E>, false))(new _SplayTreeNode(element)), compare);
485 } 485 }
486 } 486 }
487 } 487 }
488 void removeAll(Iterable<Object> elements) { 488 void removeAll(Iterable<Object> elements) {
489 for (Object element in elements) { 489 for (Object element in elements) {
490 if (_validKey(element)) _remove(DEVC$RT.cast(element, Object, E, "CastGeneral", """line 767, column 39 of dart:collection/splay_tree.dart: """, element is E, fa lse)); 490 if (_validKey(element)) _remove(DEVC$RT.cast(element, Object, E, "CastGeneral", """line 767, column 39 of dart:collection/splay_tree.dart: """, element is E, fa lse));
491 } 491 }
492 } 492 }
493 void retainAll(Iterable<Object> elements) { 493 void retainAll(Iterable<Object> elements) {
494 SplayTreeSet<E> retainSet = new SplayTreeSet<E>(_comparator, _validKey); 494 SplayTreeSet<E> retainSet = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u4 0, dynamic __u41)) {
495 int c(dynamic x0, dynamic x1) => f(x0, x1);
496 return f == null ? null : c;
497 }
498 , _comparator, __t33, DEVC$RT.type((__t42<E> _) {
499 }
500 ), "Wrap", """line 773, column 53 of dart:collection/splay_tree.dart: """, _comp arator is __t42<E>), _validKey);
495 int modificationCount = _modificationCount; 501 int modificationCount = _modificationCount;
496 for (Object object in elements) { 502 for (Object object in elements) {
497 if (modificationCount != _modificationCount) { 503 if (modificationCount != _modificationCount) {
498 throw new ConcurrentModificationError(this); 504 throw new ConcurrentModificationError(this);
499 } 505 }
500 if (_validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CastGeneral", """line 781, column 39 of dart:collection/splay_tree.dart: """, object is E, fal se)) == 0) retainSet.add(_root.key); 506 if (_validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CastGeneral", """line 781, column 39 of dart:collection/splay_tree.dart: """, object is E, fal se)) == 0) retainSet.add(_root.key);
501 } 507 }
502 if (retainSet._count != _count) { 508 if (retainSet._count != _count) {
503 _root = retainSet._root; 509 _root = retainSet._root;
504 _count = retainSet._count; 510 _count = retainSet._count;
505 _modificationCount++; 511 _modificationCount++;
506 } 512 }
507 } 513 }
508 E lookup(Object object) { 514 E lookup(Object object) {
509 if (!_validKey(object)) return null; 515 if (!_validKey(object)) return null;
510 int comp = _splay(DEVC$RT.cast(object, Object, E, "CastGeneral", """line 793, c olumn 23 of dart:collection/splay_tree.dart: """, object is E, false)); 516 int comp = _splay(DEVC$RT.cast(object, Object, E, "CastGeneral", """line 793, c olumn 23 of dart:collection/splay_tree.dart: """, object is E, false));
511 if (comp != 0) return null; 517 if (comp != 0) return null;
512 return _root.key; 518 return _root.key;
513 } 519 }
514 Set<E> intersection(Set<E> other) { 520 Set<E> intersection(Set<E> other) {
515 Set<E> result = new SplayTreeSet<E>(_comparator, _validKey); 521 Set<E> result = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u45, dynamic _ _u46)) {
522 int c(dynamic x0, dynamic x1) => f(x0, x1);
523 return f == null ? null : c;
524 }
525 , _comparator, __t33, DEVC$RT.type((__t42<E> _) {
526 }
527 ), "Wrap", """line 799, column 41 of dart:collection/splay_tree.dart: """, _comp arator is __t42<E>), _validKey);
516 for (E element in this) { 528 for (E element in this) {
517 if (other.contains(element)) result.add(element); 529 if (other.contains(element)) result.add(element);
518 } 530 }
519 return result; 531 return result;
520 } 532 }
521 Set<E> difference(Set<E> other) { 533 Set<E> difference(Set<E> other) {
522 Set<E> result = new SplayTreeSet<E>(_comparator, _validKey); 534 Set<E> result = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u47, dynamic _ _u48)) {
535 int c(dynamic x0, dynamic x1) => f(x0, x1);
536 return f == null ? null : c;
537 }
538 , _comparator, __t33, DEVC$RT.type((__t42<E> _) {
539 }
540 ), "Wrap", """line 807, column 41 of dart:collection/splay_tree.dart: """, _comp arator is __t42<E>), _validKey);
523 for (E element in this) { 541 for (E element in this) {
524 if (!other.contains(element)) result.add(element); 542 if (!other.contains(element)) result.add(element);
525 } 543 }
526 return result; 544 return result;
527 } 545 }
528 Set<E> union(Set<E> other) { 546 Set<E> union(Set<E> other) {
529 return _clone()..addAll(other); 547 return _clone()..addAll(other);
530 } 548 }
531 SplayTreeSet<E> _clone() { 549 SplayTreeSet<E> _clone() {
532 var set = new SplayTreeSet<E>(_comparator, _validKey); 550 var set = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u49, dynamic __u50)) {
551 int c(dynamic x0, dynamic x1) => f(x0, x1);
552 return f == null ? null : c;
553 }
554 , _comparator, __t33, DEVC$RT.type((__t42<E> _) {
555 }
556 ), "Wrap", """line 819, column 35 of dart:collection/splay_tree.dart: """, _comp arator is __t42<E>), _validKey);
533 set._count = _count; 557 set._count = _count;
534 set._root = _copyNode(_root); 558 set._root = _copyNode(_root);
535 return set; 559 return set;
536 } 560 }
537 _SplayTreeNode<E> _copyNode(_SplayTreeNode<E> node) { 561 _SplayTreeNode<E> _copyNode(_SplayTreeNode<E> node) {
538 if (node == null) return null; 562 if (node == null) return null;
539 return new _SplayTreeNode<E>(node.key)..left = _copyNode(node.left)..right = _c opyNode(node.right); 563 return new _SplayTreeNode<E>(node.key)..left = _copyNode(node.left)..right = _c opyNode(node.right);
540 } 564 }
541 void clear() { 565 void clear() {
542 _clear(); 566 _clear();
543 } 567 }
544 Set<E> toSet() => _clone(); 568 Set<E> toSet() => _clone();
545 String toString() => IterableBase.iterableToFullString(this, '{', '}'); 569 String toString() => IterableBase.iterableToFullString(this, '{', '}');
546 } 570 }
547 typedef int __t33<K>(K __u34, K __u35); 571 typedef int __t20<K>(K __u21, K __u22);
548 typedef bool __t37(dynamic __u38); 572 typedef bool __t24(dynamic __u25);
549 typedef int __t43<K>(K __u44, K __u45); 573 typedef int __t30<K>(K __u31, K __u32);
550 typedef int __t46(dynamic __u47, dynamic __u48); 574 typedef int __t33(dynamic __u34, dynamic __u35);
575 typedef int __t42<E>(E __u43, E __u44);
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/collection/queue.dart ('k') | test/dart_codegen/expect/convert/json.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698