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

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

Issue 1038213003: Downward inference (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Implement named arguments, some fixes 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.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 = ((__x23) => DEVC$RT.cast(__x23, dynamic, DEVC$RT.type((__t20<K> _) { 150 SplayTreeMap([int compare(K key1, K key2), bool isValidKey(potentialKey)]) : _c omparator = ((__x22) => DEVC$RT.cast(__x22, dynamic, DEVC$RT.type((__t19<K> _) {
151 } 151 }
152 ), "CompositeCast", """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, "CompositeCast", " ""line 269, column 21 of dart:collection/splay_tree.dart: """, __x26 is __t24, f alse))((isValidKey != null) ? isValidKey : ((v) => v is K)); 152 ), "CompositeCast", """line 268, column 23 of dart:collection/splay_tree.dart: " "", __x22 is __t19<K>, false))((compare == null) ? Comparable.compare : compare) , _validKey = ((__x25) => DEVC$RT.cast(__x25, dynamic, __t23, "CompositeCast", " ""line 269, column 21 of dart:collection/splay_tree.dart: """, __x25 is __t23, f alse))((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, "CompositeCast", """line 278, column 40 of dart:collection/splay_tree.dart: """, v is V, false); 156 result[k] = DEVC$RT.cast(v, dynamic, V, "CompositeCast", """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 ), "AssignmentCast", """line 333, column 37 of dart:collection/splay_tree.dart: """, _root is _SplayTreeMapNode<dynamic, dynamic>, true); 185 ), "AssignmentCast", """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, "CompositeCast", """line 334, co lumn 16 of dart:collection/splay_tree.dart: """, mapRoot.value is V, false); 186 return DEVC$RT.cast(mapRoot.value, dynamic, V, "CompositeCast", """line 334, co lumn 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 = ((__x27) => DEVC$RT.cast(__x27, DEVC$RT.type((_Spla yTreeNode<dynamic> _) { 193 _SplayTreeMapNode mapRoot = ((__x26) => DEVC$RT.cast(__x26, 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 ), "AssignmentCast", """line 342, column 33 of dart:collection/splay_tree.dart: """, __x27 is _SplayTreeMapNode<dynamic, dynamic>, true))(_remove(DEVC$RT.cast(k ey, Object, K, "CompositeCast", """line 342, column 41 of dart:collection/splay_ tree.dart: """, key is K, false))); 197 ), "AssignmentCast", """line 342, column 33 of dart:collection/splay_tree.dart: """, __x26 is _SplayTreeMapNode<dynamic, dynamic>, true))(_remove(DEVC$RT.cast(k ey, Object, K, "CompositeCast", """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, "CompositeC ast", """line 343, column 33 of dart:collection/splay_tree.dart: """, mapRoot.va lue is V, false); 198 if (mapRoot != null) return DEVC$RT.cast(mapRoot.value, dynamic, V, "CompositeC ast", """line 343, column 33 of dart:collection/splay_tree.dart: """, mapRoot.va lue 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 ), "AssignmentCast", """line 353, column 35 of dart:collection/splay_tree.dart: """, _root is _SplayTreeMapNode<dynamic, dynamic>, true); 209 ), "AssignmentCast", """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(((__x28) => DEVC$RT.cast(__x28, DEVC$RT.type((_SplayTreeMapNode<dyn amic, dynamic> _) { 212 _addNewRoot(new _SplayTreeMapNode<K, dynamic>(key, value), comp);
213 }
214 ), DEVC$RT.type((_SplayTreeNode<K> _) {
215 }
216 ), "InferableAllocation", """line 357, column 17 of dart:collection/splay_tree.d art: """, __x28 is _SplayTreeNode<K>, false))(new _SplayTreeMapNode(key, value)) , comp);
217 } 213 }
218 V putIfAbsent(K key, V ifAbsent()) { 214 V putIfAbsent(K key, V ifAbsent()) {
219 if (key == null) throw new ArgumentError(key); 215 if (key == null) throw new ArgumentError(key);
220 int comp = _splay(key); 216 int comp = _splay(key);
221 if (comp == 0) { 217 if (comp == 0) {
222 _SplayTreeMapNode mapRoot = DEVC$RT.cast(_root, DEVC$RT.type((_SplayTreeNode<K> _) { 218 _SplayTreeMapNode mapRoot = DEVC$RT.cast(_root, DEVC$RT.type((_SplayTreeNode<K> _) {
223 } 219 }
224 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) { 220 ), DEVC$RT.type((_SplayTreeMapNode<dynamic, dynamic> _) {
225 } 221 }
226 ), "AssignmentCast", """line 365, column 35 of dart:collection/splay_tree.dart: """, _root is _SplayTreeMapNode<dynamic, dynamic>, true); 222 ), "AssignmentCast", """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, "CompositeCast", """line 366, co lumn 14 of dart:collection/splay_tree.dart: """, mapRoot.value is V, false); 223 return DEVC$RT.cast(mapRoot.value, dynamic, V, "CompositeCast", """line 366, co lumn 14 of dart:collection/splay_tree.dart: """, mapRoot.value is V, false);
228 } 224 }
229 int modificationCount = _modificationCount; 225 int modificationCount = _modificationCount;
230 int splayCount = _splayCount; 226 int splayCount = _splayCount;
231 V value = ifAbsent(); 227 V value = ifAbsent();
232 if (modificationCount != _modificationCount) { 228 if (modificationCount != _modificationCount) {
233 throw new ConcurrentModificationError(this); 229 throw new ConcurrentModificationError(this);
234 } 230 }
235 if (splayCount != _splayCount) { 231 if (splayCount != _splayCount) {
236 comp = _splay(key); 232 comp = _splay(key);
237 assert (comp != 0);} 233 assert (comp != 0);}
238 _addNewRoot(((__x29) => DEVC$RT.cast(__x29, DEVC$RT.type((_SplayTreeMapNode<dyn amic, dynamic> _) { 234 _addNewRoot(new _SplayTreeMapNode<K, dynamic>(key, value), comp);
239 }
240 ), DEVC$RT.type((_SplayTreeNode<K> _) {
241 }
242 ), "InferableAllocation", """line 379, column 17 of dart:collection/splay_tree.d art: """, __x29 is _SplayTreeNode<K>, false))(new _SplayTreeMapNode(key, value)) , comp);
243 return value; 235 return value;
244 } 236 }
245 void addAll(Map<K, V> other) { 237 void addAll(Map<K, V> other) {
246 other.forEach((K key, V value) { 238 other.forEach((K key, V value) {
247 this[key] = value; 239 this[key] = value;
248 } 240 }
249 ); 241 );
250 } 242 }
251 bool get isEmpty { 243 bool get isEmpty {
252 return (_root == null); 244 return (_root == null);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 385 }
394 T _getValue(_SplayTreeNode node); 386 T _getValue(_SplayTreeNode node);
395 } 387 }
396 class _SplayTreeKeyIterable<K> extends IterableBase<K> implements EfficientLeng th {_SplayTree<K> _tree; 388 class _SplayTreeKeyIterable<K> extends IterableBase<K> implements EfficientLeng th {_SplayTree<K> _tree;
397 _SplayTreeKeyIterable(this._tree); 389 _SplayTreeKeyIterable(this._tree);
398 int get length => _tree._count; 390 int get length => _tree._count;
399 bool get isEmpty => _tree._count == 0; 391 bool get isEmpty => _tree._count == 0;
400 Iterator<K> get iterator => new _SplayTreeKeyIterator<K>(_tree); 392 Iterator<K> get iterator => new _SplayTreeKeyIterator<K>(_tree);
401 Set<K> toSet() { 393 Set<K> toSet() {
402 var setOrMap = _tree; 394 var setOrMap = _tree;
403 SplayTreeSet<K> set = new SplayTreeSet<K>(DEVC$RT.cast(setOrMap._comparator, dy namic, DEVC$RT.type((__t30<K> _) { 395 SplayTreeSet<K> set = new SplayTreeSet<K>(DEVC$RT.cast(setOrMap._comparator, dy namic, DEVC$RT.type((__t27<K> _) {
404 } 396 }
405 ), "CompositeCast", """line 613, column 29 of dart:collection/splay_tree.dart: " "", setOrMap._comparator is __t30<K>, false), DEVC$RT.cast(setOrMap._validKey, d ynamic, __t24, "CompositeCast", """line 613, column 51 of dart:collection/splay_ tree.dart: """, setOrMap._validKey is __t24, false)); 397 ), "CompositeCast", """line 613, column 29 of dart:collection/splay_tree.dart: " "", setOrMap._comparator is __t27<K>, false), DEVC$RT.cast(setOrMap._validKey, d ynamic, __t23, "CompositeCast", """line 613, column 51 of dart:collection/splay_ tree.dart: """, setOrMap._validKey is __t23, false));
406 set._count = _tree._count; 398 set._count = _tree._count;
407 set._root = set._copyNode(_tree._root); 399 set._root = set._copyNode(_tree._root);
408 return set; 400 return set;
409 } 401 }
410 } 402 }
411 class _SplayTreeValueIterable<K, V> extends IterableBase<V> implements Efficien tLength {SplayTreeMap<K, V> _map; 403 class _SplayTreeValueIterable<K, V> extends IterableBase<V> implements Efficien tLength {SplayTreeMap<K, V> _map;
412 _SplayTreeValueIterable(this._map); 404 _SplayTreeValueIterable(this._map);
413 int get length => _map._count; 405 int get length => _map._count;
414 bool get isEmpty => _map._count == 0; 406 bool get isEmpty => _map._count == 0;
415 Iterator<V> get iterator => new _SplayTreeValueIterator<K, V>(_map); 407 Iterator<V> get iterator => new _SplayTreeValueIterator<K, V>(_map);
416 } 408 }
417 class _SplayTreeKeyIterator<K> extends _SplayTreeIterator<K> {_SplayTreeKeyIter ator(_SplayTree<K> map) : super(map); 409 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, "Composi teCast", """line 631, column 39 of dart:collection/splay_tree.dart: """, node.ke y is K, false); 410 K _getValue(_SplayTreeNode node) => DEVC$RT.cast(node.key, dynamic, K, "Composi teCast", """line 631, column 39 of dart:collection/splay_tree.dart: """, node.ke y is K, false);
419 } 411 }
420 class _SplayTreeValueIterator<K, V> extends _SplayTreeIterator<V> {_SplayTreeVa lueIterator(SplayTreeMap<K, V> map) : super(map); 412 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, "Co mpositeCast", """line 636, column 42 of dart:collection/splay_tree.dart: """, no de.value is V, false); 413 V _getValue(_SplayTreeMapNode node) => DEVC$RT.cast(node.value, dynamic, V, "Co mpositeCast", """line 636, column 42 of dart:collection/splay_tree.dart: """, no de.value is V, false);
422 } 414 }
423 class _SplayTreeNodeIterator<K> extends _SplayTreeIterator<_SplayTreeNode<K>> { _SplayTreeNodeIterator(_SplayTree<K> tree) : super(tree); 415 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); 416 _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> _) { 417 _SplayTreeNode<K> _getValue(_SplayTreeNode node) => DEVC$RT.cast(node, DEVC$RT. type((_SplayTreeNode<dynamic> _) {
426 } 418 }
427 ), DEVC$RT.type((_SplayTreeNode<K> _) { 419 ), DEVC$RT.type((_SplayTreeNode<K> _) {
428 } 420 }
429 ), "CompositeCast", """line 644, column 55 of dart:collection/splay_tree.dart: " "", node is _SplayTreeNode<K>, false); 421 ), "CompositeCast", """line 644, column 55 of dart:collection/splay_tree.dart: " "", node is _SplayTreeNode<K>, false);
430 } 422 }
431 class SplayTreeSet<E> extends _SplayTree<E> with IterableMixin<E>, SetMixin<E> {Comparator _comparator; 423 class SplayTreeSet<E> extends _SplayTree<E> with IterableMixin<E>, SetMixin<E> {Comparator _comparator;
432 _Predicate _validKey; 424 _Predicate _validKey;
433 SplayTreeSet([int compare(E key1, E key2), bool isValidKey(potentialKey)]) : _c omparator = ((__x36) => DEVC$RT.cast(__x36, dynamic, __t33, "CompositeCast", """ line 693, column 23 of dart:collection/splay_tree.dart: """, __x36 is __t33, fal se))((compare == null) ? Comparable.compare : compare), _validKey = ((__x37) => DEVC$RT.cast(__x37, dynamic, __t24, "CompositeCast", """line 694, column 21 of d art:collection/splay_tree.dart: """, __x37 is __t24, false))((isValidKey != null ) ? isValidKey : ((v) => v is E)); 425 SplayTreeSet([int compare(E key1, E key2), bool isValidKey(potentialKey)]) : _c omparator = ((__x33) => DEVC$RT.cast(__x33, dynamic, __t30, "CompositeCast", """ line 693, column 23 of dart:collection/splay_tree.dart: """, __x33 is __t30, fal se))((compare == null) ? Comparable.compare : compare), _validKey = ((__x34) => DEVC$RT.cast(__x34, dynamic, __t23, "CompositeCast", """line 694, column 21 of d art:collection/splay_tree.dart: """, __x34 is __t23, false))((isValidKey != null ) ? isValidKey : ((v) => v is E));
434 factory SplayTreeSet.from(Iterable elements, [int compare(E key1, E key2), bool isValidKey(potentialKey)]) { 426 factory SplayTreeSet.from(Iterable elements, [int compare(E key1, E key2), bool isValidKey(potentialKey)]) {
435 SplayTreeSet<E> result = new SplayTreeSet<E>(compare, isValidKey); 427 SplayTreeSet<E> result = new SplayTreeSet<E>(compare, isValidKey);
436 for (final E element in elements) { 428 for (final E element in elements) {
437 result.add(element); 429 result.add(element);
438 } 430 }
439 return result; 431 return result;
440 } 432 }
441 int _compare(E e1, E e2) => _comparator(e1, e2); 433 int _compare(E e1, E e2) => _comparator(e1, e2);
442 Iterator<E> get iterator => new _SplayTreeKeyIterator<E>(this); 434 Iterator<E> get iterator => new _SplayTreeKeyIterator<E>(this);
443 int get length => _count; 435 int get length => _count;
(...skipping 11 matching lines...) Expand all
455 if (_count == 0) throw IterableElementError.noElement(); 447 if (_count == 0) throw IterableElementError.noElement();
456 if (_count > 1) throw IterableElementError.tooMany(); 448 if (_count > 1) throw IterableElementError.tooMany();
457 return _root.key; 449 return _root.key;
458 } 450 }
459 bool contains(Object object) { 451 bool contains(Object object) {
460 return _validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CompositeCas t", """line 741, column 40 of dart:collection/splay_tree.dart: """, object is E, false)) == 0; 452 return _validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CompositeCas t", """line 741, column 40 of dart:collection/splay_tree.dart: """, object is E, false)) == 0;
461 } 453 }
462 bool add(E element) { 454 bool add(E element) {
463 int compare = _splay(element); 455 int compare = _splay(element);
464 if (compare == 0) return false; 456 if (compare == 0) return false;
465 _addNewRoot(((__x38) => DEVC$RT.cast(__x38, DEVC$RT.type((_SplayTreeNode<dynami c> _) { 457 _addNewRoot(new _SplayTreeNode<E>(element), compare);
466 }
467 ), DEVC$RT.type((_SplayTreeNode<E> _) {
468 }
469 ), "InferableAllocation", """line 747, column 17 of dart:collection/splay_tree.d art: """, __x38 is _SplayTreeNode<E>, false))(new _SplayTreeNode(element)), comp are);
470 return true; 458 return true;
471 } 459 }
472 bool remove(Object object) { 460 bool remove(Object object) {
473 if (!_validKey(object)) return false; 461 if (!_validKey(object)) return false;
474 return _remove(DEVC$RT.cast(object, Object, E, "CompositeCast", """line 753, co lumn 20 of dart:collection/splay_tree.dart: """, object is E, false)) != null; 462 return _remove(DEVC$RT.cast(object, Object, E, "CompositeCast", """line 753, co lumn 20 of dart:collection/splay_tree.dart: """, object is E, false)) != null;
475 } 463 }
476 void addAll(Iterable<E> elements) { 464 void addAll(Iterable<E> elements) {
477 for (E element in elements) { 465 for (E element in elements) {
478 int compare = _splay(element); 466 int compare = _splay(element);
479 if (compare != 0) { 467 if (compare != 0) {
480 _addNewRoot(((__x39) => DEVC$RT.cast(__x39, DEVC$RT.type((_SplayTreeNode<dynamic > _) { 468 _addNewRoot(new _SplayTreeNode<E>(element), compare);
481 }
482 ), DEVC$RT.type((_SplayTreeNode<E> _) {
483 }
484 ), "InferableAllocation", """line 760, column 21 of dart:collection/splay_tree.d art: """, __x39 is _SplayTreeNode<E>, false))(new _SplayTreeNode(element)), comp are);
485 } 469 }
486 } 470 }
487 } 471 }
488 void removeAll(Iterable<Object> elements) { 472 void removeAll(Iterable<Object> elements) {
489 for (Object element in elements) { 473 for (Object element in elements) {
490 if (_validKey(element)) _remove(DEVC$RT.cast(element, Object, E, "CompositeCast" , """line 767, column 39 of dart:collection/splay_tree.dart: """, element is E, false)); 474 if (_validKey(element)) _remove(DEVC$RT.cast(element, Object, E, "CompositeCast" , """line 767, column 39 of dart:collection/splay_tree.dart: """, element is E, false));
491 } 475 }
492 } 476 }
493 void retainAll(Iterable<Object> elements) { 477 void retainAll(Iterable<Object> elements) {
494 SplayTreeSet<E> retainSet = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u4 0, dynamic __u41)) { 478 SplayTreeSet<E> retainSet = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u3 5, dynamic __u36)) {
495 int c(dynamic x0, dynamic x1) => f(x0, x1); 479 int c(dynamic x0, dynamic x1) => f(x0, x1);
496 return f == null ? null : c; 480 return f == null ? null : c;
497 } 481 }
498 , _comparator, __t33, DEVC$RT.type((__t42<E> _) { 482 , _comparator, __t30, DEVC$RT.type((__t37<E> _) {
499 } 483 }
500 ), "Wrap", """line 773, column 53 of dart:collection/splay_tree.dart: """, _comp arator is __t42<E>), _validKey); 484 ), "Wrap", """line 773, column 53 of dart:collection/splay_tree.dart: """, _comp arator is __t37<E>), _validKey);
501 int modificationCount = _modificationCount; 485 int modificationCount = _modificationCount;
502 for (Object object in elements) { 486 for (Object object in elements) {
503 if (modificationCount != _modificationCount) { 487 if (modificationCount != _modificationCount) {
504 throw new ConcurrentModificationError(this); 488 throw new ConcurrentModificationError(this);
505 } 489 }
506 if (_validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CompositeCast" , """line 781, column 39 of dart:collection/splay_tree.dart: """, object is E, f alse)) == 0) retainSet.add(_root.key); 490 if (_validKey(object) && _splay(DEVC$RT.cast(object, Object, E, "CompositeCast" , """line 781, column 39 of dart:collection/splay_tree.dart: """, object is E, f alse)) == 0) retainSet.add(_root.key);
507 } 491 }
508 if (retainSet._count != _count) { 492 if (retainSet._count != _count) {
509 _root = retainSet._root; 493 _root = retainSet._root;
510 _count = retainSet._count; 494 _count = retainSet._count;
511 _modificationCount++; 495 _modificationCount++;
512 } 496 }
513 } 497 }
514 E lookup(Object object) { 498 E lookup(Object object) {
515 if (!_validKey(object)) return null; 499 if (!_validKey(object)) return null;
516 int comp = _splay(DEVC$RT.cast(object, Object, E, "CompositeCast", """line 793, column 23 of dart:collection/splay_tree.dart: """, object is E, false)); 500 int comp = _splay(DEVC$RT.cast(object, Object, E, "CompositeCast", """line 793, column 23 of dart:collection/splay_tree.dart: """, object is E, false));
517 if (comp != 0) return null; 501 if (comp != 0) return null;
518 return _root.key; 502 return _root.key;
519 } 503 }
520 Set<E> intersection(Set<E> other) { 504 Set<E> intersection(Set<E> other) {
521 Set<E> result = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u45, dynamic _ _u46)) { 505 Set<E> result = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u40, dynamic _ _u41)) {
522 int c(dynamic x0, dynamic x1) => f(x0, x1); 506 int c(dynamic x0, dynamic x1) => f(x0, x1);
523 return f == null ? null : c; 507 return f == null ? null : c;
524 } 508 }
525 , _comparator, __t33, DEVC$RT.type((__t42<E> _) { 509 , _comparator, __t30, DEVC$RT.type((__t37<E> _) {
526 } 510 }
527 ), "Wrap", """line 799, column 41 of dart:collection/splay_tree.dart: """, _comp arator is __t42<E>), _validKey); 511 ), "Wrap", """line 799, column 41 of dart:collection/splay_tree.dart: """, _comp arator is __t37<E>), _validKey);
528 for (E element in this) { 512 for (E element in this) {
529 if (other.contains(element)) result.add(element); 513 if (other.contains(element)) result.add(element);
530 } 514 }
531 return result; 515 return result;
532 } 516 }
533 Set<E> difference(Set<E> other) { 517 Set<E> difference(Set<E> other) {
534 Set<E> result = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u47, dynamic _ _u48)) { 518 Set<E> result = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u42, dynamic _ _u43)) {
535 int c(dynamic x0, dynamic x1) => f(x0, x1); 519 int c(dynamic x0, dynamic x1) => f(x0, x1);
536 return f == null ? null : c; 520 return f == null ? null : c;
537 } 521 }
538 , _comparator, __t33, DEVC$RT.type((__t42<E> _) { 522 , _comparator, __t30, DEVC$RT.type((__t37<E> _) {
539 } 523 }
540 ), "Wrap", """line 807, column 41 of dart:collection/splay_tree.dart: """, _comp arator is __t42<E>), _validKey); 524 ), "Wrap", """line 807, column 41 of dart:collection/splay_tree.dart: """, _comp arator is __t37<E>), _validKey);
541 for (E element in this) { 525 for (E element in this) {
542 if (!other.contains(element)) result.add(element); 526 if (!other.contains(element)) result.add(element);
543 } 527 }
544 return result; 528 return result;
545 } 529 }
546 Set<E> union(Set<E> other) { 530 Set<E> union(Set<E> other) {
547 return _clone()..addAll(other); 531 return _clone()..addAll(other);
548 } 532 }
549 SplayTreeSet<E> _clone() { 533 SplayTreeSet<E> _clone() {
550 var set = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u49, dynamic __u50)) { 534 var set = new SplayTreeSet<E>(DEVC$RT.wrap((int f(dynamic __u44, dynamic __u45)) {
551 int c(dynamic x0, dynamic x1) => f(x0, x1); 535 int c(dynamic x0, dynamic x1) => f(x0, x1);
552 return f == null ? null : c; 536 return f == null ? null : c;
553 } 537 }
554 , _comparator, __t33, DEVC$RT.type((__t42<E> _) { 538 , _comparator, __t30, DEVC$RT.type((__t37<E> _) {
555 } 539 }
556 ), "Wrap", """line 819, column 35 of dart:collection/splay_tree.dart: """, _comp arator is __t42<E>), _validKey); 540 ), "Wrap", """line 819, column 35 of dart:collection/splay_tree.dart: """, _comp arator is __t37<E>), _validKey);
557 set._count = _count; 541 set._count = _count;
558 set._root = _copyNode(_root); 542 set._root = _copyNode(_root);
559 return set; 543 return set;
560 } 544 }
561 _SplayTreeNode<E> _copyNode(_SplayTreeNode<E> node) { 545 _SplayTreeNode<E> _copyNode(_SplayTreeNode<E> node) {
562 if (node == null) return null; 546 if (node == null) return null;
563 return new _SplayTreeNode<E>(node.key)..left = _copyNode(node.left)..right = _c opyNode(node.right); 547 return new _SplayTreeNode<E>(node.key)..left = _copyNode(node.left)..right = _c opyNode(node.right);
564 } 548 }
565 void clear() { 549 void clear() {
566 _clear(); 550 _clear();
567 } 551 }
568 Set<E> toSet() => _clone(); 552 Set<E> toSet() => _clone();
569 String toString() => IterableBase.iterableToFullString(this, '{', '}'); 553 String toString() => IterableBase.iterableToFullString(this, '{', '}');
570 } 554 }
571 typedef int __t20<K>(K __u21, K __u22); 555 typedef int __t19<K>(K __u20, K __u21);
572 typedef bool __t24(dynamic __u25); 556 typedef bool __t23(dynamic __u24);
573 typedef int __t30<K>(K __u31, K __u32); 557 typedef int __t27<K>(K __u28, K __u29);
574 typedef int __t33(dynamic __u34, dynamic __u35); 558 typedef int __t30(dynamic __u31, dynamic __u32);
575 typedef int __t42<E>(E __u43, E __u44); 559 typedef int __t37<E>(E __u38, E __u39);
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