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

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

Issue 977613002: Make int and double nullable by default (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: actually upload changes 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 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 ) { 172 ) {
173 for (E element in this) { 173 for (E element in this) {
174 if (test(element)) return element; 174 if (test(element)) return element;
175 } 175 }
176 if (orElse != null) return orElse(); 176 if (orElse != null) return orElse();
177 throw IterableElementError.noElement(); 177 throw IterableElementError.noElement();
178 } 178 }
179 E lastWhere(bool test(E value), { 179 E lastWhere(bool test(E value), {
180 E orElse()} 180 E orElse()}
181 ) { 181 ) {
182 E result = ((__x49) => DDC$RT.cast(__x49, Null, E, "CastLiteral", """line 244, column 16 of dart:collection/set.dart: """, __x49 is E, false))(null); 182 E result = null;
183 bool foundMatching = false; 183 bool foundMatching = false;
184 for (E element in this) { 184 for (E element in this) {
185 if (test(element)) { 185 if (test(element)) {
186 result = element; 186 result = element;
187 foundMatching = true; 187 foundMatching = true;
188 } 188 }
189 } 189 }
190 if (foundMatching) return result; 190 if (foundMatching) return result;
191 if (orElse != null) return orElse(); 191 if (orElse != null) return orElse();
192 throw IterableElementError.noElement(); 192 throw IterableElementError.noElement();
193 } 193 }
194 E singleWhere(bool test(E value)) { 194 E singleWhere(bool test(E value)) {
195 E result = ((__x50) => DDC$RT.cast(__x50, Null, E, "CastLiteral", """line 258, column 16 of dart:collection/set.dart: """, __x50 is E, false))(null); 195 E result = null;
196 bool foundMatching = false; 196 bool foundMatching = false;
197 for (E element in this) { 197 for (E element in this) {
198 if (test(element)) { 198 if (test(element)) {
199 if (foundMatching) { 199 if (foundMatching) {
200 throw IterableElementError.tooMany(); 200 throw IterableElementError.tooMany();
201 } 201 }
202 result = element; 202 result = element;
203 foundMatching = true; 203 foundMatching = true;
204 } 204 }
205 } 205 }
206 if (foundMatching) return result; 206 if (foundMatching) return result;
207 throw IterableElementError.noElement(); 207 throw IterableElementError.noElement();
208 } 208 }
209 E elementAt(int index) { 209 E elementAt(int index) {
210 if (index is! int) throw new ArgumentError.notNull("index"); 210 if (index is! int) throw new ArgumentError.notNull("index");
211 RangeError.checkNotNegative(index, "index"); 211 RangeError.checkNotNegative(index, "index");
212 int elementIndex = 0; 212 int elementIndex = 0;
213 for (E element in this) { 213 for (E element in this) {
214 if (index == elementIndex) return element; 214 if (index == elementIndex) return element;
215 elementIndex++; 215 elementIndex++;
216 } 216 }
217 throw new RangeError.index(index, this, "index", null, elementIndex); 217 throw new RangeError.index(index, this, "index", null, elementIndex);
218 } 218 }
219 } 219 }
220 abstract class SetBase<E> extends SetMixin<E> {static String setToString(Set se t) => IterableBase.iterableToFullString(set, '{', '}'); 220 abstract class SetBase<E> extends SetMixin<E> {static String setToString(Set se t) => IterableBase.iterableToFullString(set, '{', '}');
221 } 221 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698