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

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

Issue 1024073003: Treat Object and dynamic similarly (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: 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
« no previous file with comments | « test/checker/checker_test.dart ('k') | test/dart_codegen/expect/convert/json.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 part of dart.collection; 1 part of dart.collection;
2 abstract class SetMixin<E> implements Set<E> {bool add(E element); 2 abstract class SetMixin<E> implements Set<E> {bool add(E element);
3 bool contains(Object element); 3 bool contains(Object element);
4 E lookup(E element); 4 E lookup(E element);
5 bool remove(Object element); 5 bool remove(Object element);
6 Iterator<E> get iterator; 6 Iterator<E> get iterator;
7 Set<E> toSet(); 7 Set<E> toSet();
8 int get length; 8 int get length;
9 bool get isEmpty => length == 0; 9 bool get isEmpty => length == 0;
10 bool get isNotEmpty => length != 0; 10 bool get isNotEmpty => length != 0;
(...skipping 11 matching lines...) Expand all
22 for (Object o in elements) { 22 for (Object o in elements) {
23 toRemove.remove(o); 23 toRemove.remove(o);
24 } 24 }
25 removeAll(toRemove); 25 removeAll(toRemove);
26 } 26 }
27 void removeWhere(bool test(E element)) { 27 void removeWhere(bool test(E element)) {
28 List toRemove = []; 28 List toRemove = [];
29 for (E element in this) { 29 for (E element in this) {
30 if (test(element)) toRemove.add(element); 30 if (test(element)) toRemove.add(element);
31 } 31 }
32 removeAll(DEVC$RT.cast(toRemove, DEVC$RT.type((List<dynamic> _) { 32 removeAll(toRemove);
33 }
34 ), DEVC$RT.type((Iterable<Object> _) {
35 }
36 ), "CastDynamic", """line 77, column 15 of dart:collection/set.dart: """, toRe move is Iterable<Object>, true));
37 } 33 }
38 void retainWhere(bool test(E element)) { 34 void retainWhere(bool test(E element)) {
39 List toRemove = []; 35 List toRemove = [];
40 for (E element in this) { 36 for (E element in this) {
41 if (!test(element)) toRemove.add(element); 37 if (!test(element)) toRemove.add(element);
42 } 38 }
43 removeAll(DEVC$RT.cast(toRemove, DEVC$RT.type((List<dynamic> _) { 39 removeAll(toRemove);
44 }
45 ), DEVC$RT.type((Iterable<Object> _) {
46 }
47 ), "CastDynamic", """line 85, column 15 of dart:collection/set.dart: """, toRe move is Iterable<Object>, true));
48 } 40 }
49 bool containsAll(Iterable<Object> other) { 41 bool containsAll(Iterable<Object> other) {
50 for (Object o in other) { 42 for (Object o in other) {
51 if (!contains(o)) return false; 43 if (!contains(o)) return false;
52 } 44 }
53 return true; 45 return true;
54 } 46 }
55 Set<E> union(Set<E> other) { 47 Set<E> union(Set<E> other) {
56 return toSet()..addAll(other); 48 return toSet()..addAll(other);
57 } 49 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 int elementIndex = 0; 204 int elementIndex = 0;
213 for (E element in this) { 205 for (E element in this) {
214 if (index == elementIndex) return element; 206 if (index == elementIndex) return element;
215 elementIndex++; 207 elementIndex++;
216 } 208 }
217 throw new RangeError.index(index, this, "index", null, elementIndex); 209 throw new RangeError.index(index, this, "index", null, elementIndex);
218 } 210 }
219 } 211 }
220 abstract class SetBase<E> extends SetMixin<E> {static String setToString(Set se t) => IterableBase.iterableToFullString(set, '{', '}'); 212 abstract class SetBase<E> extends SetMixin<E> {static String setToString(Set se t) => IterableBase.iterableToFullString(set, '{', '}');
221 } 213 }
OLDNEW
« no previous file with comments | « test/checker/checker_test.dart ('k') | test/dart_codegen/expect/convert/json.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698