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

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

Issue 959003003: Typecheck constructor initializers properly (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 5 years, 10 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 MapBase<K, V> = Object with MapMixin<K, V>; 2 abstract class MapBase<K, V> = Object with MapMixin<K, V>;
3 abstract class MapMixin<K, V> implements Map<K, V> {Iterable<K> get keys; 3 abstract class MapMixin<K, V> implements Map<K, V> {Iterable<K> get keys;
4 V operator [](Object key); 4 V operator [](Object key);
5 operator []=(K key, V value); 5 operator []=(K key, V value);
6 V remove(Object key); 6 V remove(Object key);
7 void clear(); 7 void clear();
8 void forEach(void action(K key, V value)) { 8 void forEach(void action(K key, V value)) {
9 for (K key in keys) { 9 for (K key in keys) {
10 action(key, this[key]); 10 action(key, this[key]);
(...skipping 22 matching lines...) Expand all
33 bool get isNotEmpty => keys.isNotEmpty; 33 bool get isNotEmpty => keys.isNotEmpty;
34 Iterable<V> get values => new _MapBaseValueIterable<V>(this); 34 Iterable<V> get values => new _MapBaseValueIterable<V>(this);
35 String toString() => Maps.mapToString(this); 35 String toString() => Maps.mapToString(this);
36 } 36 }
37 abstract class UnmodifiableMapBase<K, V> = MapBase<K, V> with _UnmodifiableMapM ixin<K, V>; 37 abstract class UnmodifiableMapBase<K, V> = MapBase<K, V> with _UnmodifiableMapM ixin<K, V>;
38 class _MapBaseValueIterable<V> extends IterableBase<V> implements EfficientLeng th {final Map _map; 38 class _MapBaseValueIterable<V> extends IterableBase<V> implements EfficientLeng th {final Map _map;
39 _MapBaseValueIterable(this._map); 39 _MapBaseValueIterable(this._map);
40 int get length => _map.length; 40 int get length => _map.length;
41 bool get isEmpty => _map.isEmpty; 41 bool get isEmpty => _map.isEmpty;
42 bool get isNotEmpty => _map.isNotEmpty; 42 bool get isNotEmpty => _map.isNotEmpty;
43 V get first => ((__x26) => DDC$RT.cast(__x26, dynamic, V, "CastGeneral", """lin e 122, column 18 of dart:collection/maps.dart: """, __x26 is V, false))(_map[_ma p.keys.first]); 43 V get first => ((__x32) => DDC$RT.cast(__x32, dynamic, V, "CastGeneral", """lin e 122, column 18 of dart:collection/maps.dart: """, __x32 is V, false))(_map[_ma p.keys.first]);
44 V get single => ((__x27) => DDC$RT.cast(__x27, dynamic, V, "CastGeneral", """li ne 123, column 19 of dart:collection/maps.dart: """, __x27 is V, false))(_map[_m ap.keys.single]); 44 V get single => ((__x33) => DDC$RT.cast(__x33, dynamic, V, "CastGeneral", """li ne 123, column 19 of dart:collection/maps.dart: """, __x33 is V, false))(_map[_m ap.keys.single]);
45 V get last => ((__x28) => DDC$RT.cast(__x28, dynamic, V, "CastGeneral", """line 124, column 17 of dart:collection/maps.dart: """, __x28 is V, false))(_map[_map .keys.last]); 45 V get last => ((__x34) => DDC$RT.cast(__x34, dynamic, V, "CastGeneral", """line 124, column 17 of dart:collection/maps.dart: """, __x34 is V, false))(_map[_map .keys.last]);
46 Iterator<V> get iterator => new _MapBaseValueIterator<V>(_map); 46 Iterator<V> get iterator => new _MapBaseValueIterator<V>(_map);
47 } 47 }
48 class _MapBaseValueIterator<V> implements Iterator<V> {final Iterator _keys; 48 class _MapBaseValueIterator<V> implements Iterator<V> {final Iterator _keys;
49 final Map _map; 49 final Map _map;
50 V _current = ((__x29) => DDC$RT.cast(__x29, Null, V, "CastLiteral", """line 138 , column 16 of dart:collection/maps.dart: """, __x29 is V, false))(null); 50 V _current = ((__x35) => DDC$RT.cast(__x35, Null, V, "CastLiteral", """line 138 , column 16 of dart:collection/maps.dart: """, __x35 is V, false))(null);
51 _MapBaseValueIterator(Map map) : _map = map, _keys = map.keys.iterator; 51 _MapBaseValueIterator(Map map) : _map = map, _keys = map.keys.iterator;
52 bool moveNext() { 52 bool moveNext() {
53 if (_keys.moveNext()) { 53 if (_keys.moveNext()) {
54 _current = ((__x30) => DDC$RT.cast(__x30, dynamic, V, "CastGeneral", """line 144 , column 18 of dart:collection/maps.dart: """, __x30 is V, false))(_map[_keys.cu rrent]); 54 _current = ((__x36) => DDC$RT.cast(__x36, dynamic, V, "CastGeneral", """line 144 , column 18 of dart:collection/maps.dart: """, __x36 is V, false))(_map[_keys.cu rrent]);
55 return true; 55 return true;
56 } 56 }
57 _current = ((__x31) => DDC$RT.cast(__x31, Null, V, "CastLiteral", """line 147, column 16 of dart:collection/maps.dart: """, __x31 is V, false))(null); 57 _current = ((__x37) => DDC$RT.cast(__x37, Null, V, "CastLiteral", """line 147, column 16 of dart:collection/maps.dart: """, __x37 is V, false))(null);
58 return false; 58 return false;
59 } 59 }
60 V get current => _current; 60 V get current => _current;
61 } 61 }
62 abstract class _UnmodifiableMapMixin<K, V> implements Map<K, V> {void operator []=(K key, V value) { 62 abstract class _UnmodifiableMapMixin<K, V> implements Map<K, V> {void operator []=(K key, V value) {
63 throw new UnsupportedError("Cannot modify unmodifiable map"); 63 throw new UnsupportedError("Cannot modify unmodifiable map");
64 } 64 }
65 void addAll(Map<K, V> other) { 65 void addAll(Map<K, V> other) {
66 throw new UnsupportedError("Cannot modify unmodifiable map"); 66 throw new UnsupportedError("Cannot modify unmodifiable map");
67 } 67 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 while (hasNextKey && hasNextValue) { 184 while (hasNextKey && hasNextValue) {
185 map[keyIterator.current] = valueIterator.current; 185 map[keyIterator.current] = valueIterator.current;
186 hasNextKey = keyIterator.moveNext(); 186 hasNextKey = keyIterator.moveNext();
187 hasNextValue = valueIterator.moveNext(); 187 hasNextValue = valueIterator.moveNext();
188 } 188 }
189 if (hasNextKey || hasNextValue) { 189 if (hasNextKey || hasNextValue) {
190 throw new ArgumentError("Iterables do not have same length."); 190 throw new ArgumentError("Iterables do not have same length.");
191 } 191 }
192 } 192 }
193 } 193 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/collection/list.dart ('k') | test/dart_codegen/expect/collection/queue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698