From 0b916763629b104ed4b20398a63256b259516a94 Mon Sep 17 00:00:00 2001 From: "Lasse R.H. Nielsen" Date: Tue, 12 Jun 2018 14:36:09 +0000 Subject: [PATCH] Remove the `retype` method. See #33075. Bug: http://dartbug.com/33075 Change-Id: I1ee2f587afbc672dd08ac61ac003bbdc85bb95e2 Reviewed-on: https://dart-review.googlesource.com/59091 Commit-Queue: Lasse R.H. Nielsen Reviewed-by: Leaf Petersen --- CHANGELOG.md | 3 +++ DEPS | 2 +- .../lib/src/helpers/debug_collection.dart | 16 ------------- .../lib/src/helpers/expensive_map.dart | 4 ---- pkg/compiler/lib/src/helpers/track_map.dart | 4 ---- pkg/compiler/lib/src/util/emptyset.dart | 4 ---- pkg/compiler/lib/src/util/setlet.dart | 4 ---- .../tool/input_sdk/private/js_array.dart | 4 ---- runtime/lib/compact_hash.dart | 11 --------- runtime/lib/immutable_map.dart | 4 ---- runtime/lib/typed_data_patch.dart | 20 ---------------- ..._service_asynchronous_invocation_test.dart | 2 +- .../external_service_disappear_test.dart | 2 +- ..._service_notification_invocation_test.dart | 4 ++-- .../external_service_registration_test.dart | 2 +- ...ce_registration_via_notification_test.dart | 2 +- ...l_service_synchronous_invocation_test.dart | 2 +- .../swarm_ui_lib/observable/observable.dart | 4 ---- sdk/lib/_http/http_session.dart | 4 ---- .../js_runtime/lib/constant_map.dart | 4 ---- .../_internal/js_runtime/lib/js_array.dart | 4 ---- sdk/lib/async/stream.dart | 10 -------- sdk/lib/collection/collections.dart | 4 ---- sdk/lib/collection/hash_set.dart | 4 ---- sdk/lib/collection/iterable.dart | 4 ---- sdk/lib/collection/list.dart | 4 ---- sdk/lib/collection/maps.dart | 11 --------- sdk/lib/collection/queue.dart | 12 ---------- sdk/lib/collection/set.dart | 4 ---- sdk/lib/collection/splay_tree.dart | 4 ---- sdk/lib/convert/converter.dart | 3 --- sdk/lib/core/iterable.dart | 4 ---- sdk/lib/core/list.dart | 4 ---- sdk/lib/core/map.dart | 4 ---- sdk/lib/core/set.dart | 4 ---- sdk/lib/html/dart2js/html_dart2js.dart | 8 ------- sdk/lib/internal/async_cast.dart | 10 -------- sdk/lib/internal/cast.dart | 7 ------ tests/corelib_2/cast_test.dart | 2 +- tests/corelib_2/growable_list_test.dart | 3 --- .../list_unmodifiable_cast_test.dart | 5 ---- .../corelib_2/map_unmodifiable_cast_test.dart | 23 ++----------------- tools/dom/src/AttributeMap.dart | 8 ------- 43 files changed, 14 insertions(+), 234 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b7a74ab191..f8df431e4ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,9 @@ be inferred as `void`. * `dart:convert` * Allow `utf8.decoder.fuse(json.decoder)` to ignore leading Unicode BOM. +* `dart:core`/`dart:collection` + * Remove the `retype` method on iterables and maps again. Use `cast` instead. + ### Tool Changes #### Analyzer diff --git a/DEPS b/DEPS index 544ccdc2ee4..498724a2b3a 100644 --- a/DEPS +++ b/DEPS @@ -59,7 +59,7 @@ vars = { "charcode_tag": "v1.1.1", "chrome_rev" : "19997", "cli_util_tag" : "0.1.2+1", - "collection_tag": "1.14.9", + "collection_tag": "1.14.10", "convert_tag": "2.0.1", "crypto_tag" : "2.0.2+1", "csslib_tag" : "0.14.1", diff --git a/pkg/compiler/lib/src/helpers/debug_collection.dart b/pkg/compiler/lib/src/helpers/debug_collection.dart index 03ac0e9edc2..c7b9f79a226 100644 --- a/pkg/compiler/lib/src/helpers/debug_collection.dart +++ b/pkg/compiler/lib/src/helpers/debug_collection.dart @@ -22,10 +22,6 @@ class DebugMap implements Map { } Map cast() => Map.castFrom(this); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - bool containsValue(Object value) { return sourceMap.containsValue(value); } @@ -108,10 +104,6 @@ class DebugIterable implements Iterable { Iterator get iterator => iterable.iterator; Iterable cast() => Iterable.castFrom(this); - - @Deprecated("Use cast instead.") - Iterable retype() => cast(); - Iterable map(T f(E element)) => iterable.map(f); Iterable where(bool test(E element)) => iterable.where(test); @@ -190,10 +182,6 @@ class DebugList extends DebugIterable implements List { List get list => iterable; List cast() => List.castFrom(this); - - @Deprecated("Use cast instead.") - List retype() => cast(); - List operator +(List other) => list + other; E operator [](int index) => list[index]; @@ -297,10 +285,6 @@ class DebugSet extends DebugIterable implements Set { Set get set => iterable; Set cast() => Set.castFrom(this); - - @Deprecated("Use cast instead.") - Set retype() => cast(); - bool contains(Object value) => set.contains(value); bool add(E value) { diff --git a/pkg/compiler/lib/src/helpers/expensive_map.dart b/pkg/compiler/lib/src/helpers/expensive_map.dart index 48be3849459..5f5cb442226 100644 --- a/pkg/compiler/lib/src/helpers/expensive_map.dart +++ b/pkg/compiler/lib/src/helpers/expensive_map.dart @@ -69,10 +69,6 @@ class ExpensiveMap extends MapBase { } Map cast() => Map.castFrom(this); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - Iterable> get entries => _maps[0].entries; void addEntries(Iterable> entries) { diff --git a/pkg/compiler/lib/src/helpers/track_map.dart b/pkg/compiler/lib/src/helpers/track_map.dart index 0a87cf5fd63..7c2eb86bad6 100644 --- a/pkg/compiler/lib/src/helpers/track_map.dart +++ b/pkg/compiler/lib/src/helpers/track_map.dart @@ -98,10 +98,6 @@ class TrackMap implements Map { } Map cast() => _map.cast(); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - Iterable> get entries => _map.entries; void addEntries(Iterable> entries) { diff --git a/pkg/compiler/lib/src/util/emptyset.dart b/pkg/compiler/lib/src/util/emptyset.dart index 1fa3dbaddb1..796498b37a7 100644 --- a/pkg/compiler/lib/src/util/emptyset.dart +++ b/pkg/compiler/lib/src/util/emptyset.dart @@ -10,10 +10,6 @@ class ImmutableEmptySet extends IterableBase implements Set { const ImmutableEmptySet(); Set cast() => new ImmutableEmptySet(); - - @Deprecated("Use cast instead.") - Set retype() => cast(); - get iterator => const _EmptySetIterator(); int get length => 0; bool get isEmpty => true; diff --git a/pkg/compiler/lib/src/util/setlet.dart b/pkg/compiler/lib/src/util/setlet.dart index 62ccde09549..7335c77e7a7 100644 --- a/pkg/compiler/lib/src/util/setlet.dart +++ b/pkg/compiler/lib/src/util/setlet.dart @@ -30,10 +30,6 @@ class Setlet extends SetBase { static Set _newSet() => new Setlet(); Set cast() => Set.castFrom(this, newSet: _newSet); - - @Deprecated("Use cast instead.") - Set retype() => cast(); - Iterator get iterator { if (_extra == null) { return new _SetletSingleIterator(_contents); diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_array.dart b/pkg/dev_compiler/tool/input_sdk/private/js_array.dart index e392cfb762a..7dba1a8563c 100644 --- a/pkg/dev_compiler/tool/input_sdk/private/js_array.dart +++ b/pkg/dev_compiler/tool/input_sdk/private/js_array.dart @@ -69,10 +69,6 @@ class JSArray implements List, JSIndexable { } List cast() => List.castFrom(this); - - @Deprecated("Use cast instead.") - List retype() => cast(); - void add(E value) { checkGrowable('add'); JS('void', r'#.push(#)', this, value); diff --git a/runtime/lib/compact_hash.dart b/runtime/lib/compact_hash.dart index fb3d938b0e6..21179eb639e 100644 --- a/runtime/lib/compact_hash.dart +++ b/runtime/lib/compact_hash.dart @@ -461,10 +461,6 @@ class _CompactLinkedHashSet extends _HashFieldBase static Set _newEmpty() => new _CompactLinkedHashSet(); Set cast() => Set.castFrom(this, newSet: _newEmpty); - - @Deprecated("Use cast instead.") - Set retype() => cast(); - int get length => _usedData - _deletedKeys; E get first { @@ -622,9 +618,6 @@ class _CompactLinkedIdentityHashSet extends _CompactLinkedHashSet static Set _newEmpty() => new _CompactLinkedIdentityHashSet(); Set cast() => Set.castFrom(this, newSet: _newEmpty); - - @Deprecated("Use cast instead.") - Set retype() => cast(); } class _CompactLinkedCustomHashSet extends _CompactLinkedHashSet { @@ -643,10 +636,6 @@ class _CompactLinkedCustomHashSet extends _CompactLinkedHashSet { : _validKey = (validKey != null) ? validKey : new _TypeTest().test; Set cast() => Set.castFrom(this); - - @Deprecated("Use cast instead.") - Set retype() => cast(); - Set toSet() => new _CompactLinkedCustomHashSet(_equality, _hasher, _validKey) ..addAll(this); diff --git a/runtime/lib/immutable_map.dart b/runtime/lib/immutable_map.dart index 2057a574eb6..c9d51a83ae4 100644 --- a/runtime/lib/immutable_map.dart +++ b/runtime/lib/immutable_map.dart @@ -14,10 +14,6 @@ class _ImmutableMap implements Map { : _kvPairs = keyValuePairs; Map cast() => Map.castFrom(this); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - V operator [](Object key) { // To preserve the key-value order of the map literal, the keys are // not sorted. Need to do linear search or implement an additional diff --git a/runtime/lib/typed_data_patch.dart b/runtime/lib/typed_data_patch.dart index b3aaf23b6c3..29ab7b75ecb 100644 --- a/runtime/lib/typed_data_patch.dart +++ b/runtime/lib/typed_data_patch.dart @@ -124,10 +124,6 @@ abstract class _IntListMixin implements List { new FollowedByIterable.firstEfficient(this, other); List cast() => List.castFrom(this); - - @Deprecated("Use cast instead.") - List retype() => cast(); - void set first(int value) { if (this.length == 0) throw new RangeError.index(0, this); this[0] = value; @@ -485,10 +481,6 @@ abstract class _DoubleListMixin implements List { new FollowedByIterable.firstEfficient(this, other); List cast() => List.castFrom(this); - - @Deprecated("Use cast instead.") - List retype() => cast(); - void set first(double value) { if (this.length == 0) throw new RangeError.index(0, this); this[0] = value; @@ -849,10 +841,6 @@ abstract class _Float32x4ListMixin implements List { new FollowedByIterable.firstEfficient(this, other); List cast() => List.castFrom(this); - - @Deprecated("Use cast instead.") - List retype() => cast(); - void set first(Float32x4 value) { if (this.length == 0) throw new RangeError.index(0, this); this[0] = value; @@ -1217,10 +1205,6 @@ abstract class _Int32x4ListMixin implements List { new FollowedByIterable.firstEfficient(this, other); List cast() => List.castFrom(this); - - @Deprecated("Use cast instead.") - List retype() => cast(); - void set first(Int32x4 value) { if (this.length == 0) throw new RangeError.index(0, this); this[0] = value; @@ -1584,10 +1568,6 @@ abstract class _Float64x2ListMixin implements List { new FollowedByIterable.firstEfficient(this, other); List cast() => List.castFrom(this); - - @Deprecated("Use cast instead.") - List retype() => cast(); - void set first(Float64x2 value) { if (this.length == 0) throw new RangeError.index(0, this); this[0] = value; diff --git a/runtime/observatory/tests/service/external_service_asynchronous_invocation_test.dart b/runtime/observatory/tests/service/external_service_asynchronous_invocation_test.dart index c4671591e77..fb56834c9f1 100644 --- a/runtime/observatory/tests/service/external_service_asynchronous_invocation_test.dart +++ b/runtime/observatory/tests/service/external_service_asynchronous_invocation_test.dart @@ -24,7 +24,7 @@ var tests = [ // Avoid to manually encode and decode messages from the stream Stream stream = socket.stream.map(jsonEncode); - stream.retype().pipe(_socket); + stream.cast().pipe(_socket); dynamic _decoder(dynamic obj) { return jsonDecode(obj); } diff --git a/runtime/observatory/tests/service/external_service_disappear_test.dart b/runtime/observatory/tests/service/external_service_disappear_test.dart index 7f39fad88b0..5c9764e171a 100644 --- a/runtime/observatory/tests/service/external_service_disappear_test.dart +++ b/runtime/observatory/tests/service/external_service_disappear_test.dart @@ -24,7 +24,7 @@ var tests = [ // Avoid to manually encode and decode messages from the stream Stream stream = socket.stream.map(jsonEncode); - stream.retype().pipe(_socket); + stream.cast().pipe(_socket); dynamic _decoder(dynamic obj) { return jsonDecode(obj); } diff --git a/runtime/observatory/tests/service/external_service_notification_invocation_test.dart b/runtime/observatory/tests/service/external_service_notification_invocation_test.dart index 2c064afb7c5..cab8b5bf418 100644 --- a/runtime/observatory/tests/service/external_service_notification_invocation_test.dart +++ b/runtime/observatory/tests/service/external_service_notification_invocation_test.dart @@ -27,10 +27,10 @@ var tests = [ // Avoid to manually encode and decode messages from the stream Stream socket_stream = socket.stream.map(jsonEncode); - socket_stream.retype().pipe(_socket); + socket_stream.cast().pipe(_socket); Stream socket_invoker_stream = socket_invoker.stream.map(jsonEncode); - socket_invoker_stream.retype().pipe(_socket_invoker); + socket_invoker_stream.cast().pipe(_socket_invoker); dynamic _decoder(dynamic obj) { return jsonDecode(obj); } diff --git a/runtime/observatory/tests/service/external_service_registration_test.dart b/runtime/observatory/tests/service/external_service_registration_test.dart index 3b6cfa0c311..7fb325b6fd8 100644 --- a/runtime/observatory/tests/service/external_service_registration_test.dart +++ b/runtime/observatory/tests/service/external_service_registration_test.dart @@ -27,7 +27,7 @@ var tests = [ // Avoid to manually encode and decode messages from the stream Stream socket_stream = socket.stream.map(jsonEncode); - socket_stream.retype().pipe(_socket); + socket_stream.cast().pipe(_socket); dynamic _decoder(dynamic obj) { return jsonDecode(obj); } diff --git a/runtime/observatory/tests/service/external_service_registration_via_notification_test.dart b/runtime/observatory/tests/service/external_service_registration_via_notification_test.dart index 846f28baf04..0f05750648b 100644 --- a/runtime/observatory/tests/service/external_service_registration_via_notification_test.dart +++ b/runtime/observatory/tests/service/external_service_registration_via_notification_test.dart @@ -27,7 +27,7 @@ var tests = [ // Avoid to manually encode and decode messages from the stream Stream stream = socket.stream.map(jsonEncode); - stream.retype().pipe(_socket); + stream.cast().pipe(_socket); dynamic _decoder(dynamic obj) { return jsonDecode(obj); } diff --git a/runtime/observatory/tests/service/external_service_synchronous_invocation_test.dart b/runtime/observatory/tests/service/external_service_synchronous_invocation_test.dart index 43405ad6325..b16e5ff236b 100644 --- a/runtime/observatory/tests/service/external_service_synchronous_invocation_test.dart +++ b/runtime/observatory/tests/service/external_service_synchronous_invocation_test.dart @@ -24,7 +24,7 @@ var tests = [ // Avoid to manually encode and decode messages from the stream Stream stream = socket.stream.map(jsonEncode); - stream.retype().pipe(_socket); + stream.cast().pipe(_socket); dynamic _decoder(dynamic obj) { return jsonDecode(obj); } diff --git a/samples-dev/swarm/swarm_ui_lib/observable/observable.dart b/samples-dev/swarm/swarm_ui_lib/observable/observable.dart index 4ae4097ef50..6f48db96649 100644 --- a/samples-dev/swarm/swarm_ui_lib/observable/observable.dart +++ b/samples-dev/swarm/swarm_ui_lib/observable/observable.dart @@ -147,10 +147,6 @@ class ObservableList extends AbstractObservable int get length => _internal.length; List cast() => _internal.cast(); - - @Deprecated("Use cast instead.") - List retype() => cast(); - Iterable whereType() => _internal.whereType(); List operator +(List other) => _internal + other; diff --git a/sdk/lib/_http/http_session.dart b/sdk/lib/_http/http_session.dart index baca21b8bee..39076098278 100644 --- a/sdk/lib/_http/http_session.dart +++ b/sdk/lib/_http/http_session.dart @@ -78,10 +78,6 @@ class _HttpSession implements HttpSession { } Map cast() => _data.cast(); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - update(key, update(value), {ifAbsent()}) => _data.update(key, update, ifAbsent: ifAbsent); diff --git a/sdk/lib/_internal/js_runtime/lib/constant_map.dart b/sdk/lib/_internal/js_runtime/lib/constant_map.dart index 6047b2d6d23..f7c7936a004 100644 --- a/sdk/lib/_internal/js_runtime/lib/constant_map.dart +++ b/sdk/lib/_internal/js_runtime/lib/constant_map.dart @@ -48,10 +48,6 @@ abstract class ConstantMap implements Map { const ConstantMap._(); Map cast() => Map.castFrom(this); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - bool get isEmpty => length == 0; bool get isNotEmpty => !isEmpty; diff --git a/sdk/lib/_internal/js_runtime/lib/js_array.dart b/sdk/lib/_internal/js_runtime/lib/js_array.dart index df030037e40..9d0a48ea6a6 100644 --- a/sdk/lib/_internal/js_runtime/lib/js_array.dart +++ b/sdk/lib/_internal/js_runtime/lib/js_array.dart @@ -120,10 +120,6 @@ class JSArray extends Interceptor implements List, JSIndexable { } List cast() => List.castFrom(this); - - @Deprecated("Use cast instead.") - List retype() => cast(); - void add(E value) { checkGrowable('add'); JS('void', r'#.push(#)', this, value); diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart index 5df84c57550..a5a00555ef9 100644 --- a/sdk/lib/async/stream.dart +++ b/sdk/lib/async/stream.dart @@ -939,10 +939,6 @@ abstract class Stream { * each data event emitted by this stream is also an instance of [R]. */ Stream cast() => Stream.castFrom(this); - - @Deprecated("Use cast instead.") - Stream retype() => cast(); - /** * Collects all elements of this stream in a [List]. * @@ -2020,9 +2016,6 @@ abstract class StreamTransformer { * are acually instances of [RT]. */ StreamTransformer cast(); - - @Deprecated("Use cast instead.") - StreamTransformer retype(); } /** @@ -2035,9 +2028,6 @@ abstract class StreamTransformerBase implements StreamTransformer { StreamTransformer cast() => StreamTransformer.castFrom(this); - - @Deprecated("Use cast instead.") - StreamTransformer retype() => cast(); } /** diff --git a/sdk/lib/collection/collections.dart b/sdk/lib/collection/collections.dart index f20b5ce937f..d02257b117e 100644 --- a/sdk/lib/collection/collections.dart +++ b/sdk/lib/collection/collections.dart @@ -22,10 +22,6 @@ class UnmodifiableListView extends UnmodifiableListBase { UnmodifiableListView(Iterable source) : _source = source; List cast() => new UnmodifiableListView(_source.cast()); - - @Deprecated("Use cast instead.") - List retype() => cast(); - int get length => _source.length; E operator [](int index) => _source.elementAt(index); diff --git a/sdk/lib/collection/hash_set.dart b/sdk/lib/collection/hash_set.dart index b75dc446812..8f3f7150066 100644 --- a/sdk/lib/collection/hash_set.dart +++ b/sdk/lib/collection/hash_set.dart @@ -15,10 +15,6 @@ abstract class _HashSetBase extends SetBase { Set _newSimilarSet(); Set cast() => Set.castFrom(this, newSet: _newSimilarSet); - - @Deprecated("Use cast instead.") - Set retype() => cast(); - Set difference(Set other) { Set result = _newSet(); for (var element in this) { diff --git a/sdk/lib/collection/iterable.dart b/sdk/lib/collection/iterable.dart index fe1873a672d..fcad61f2b96 100644 --- a/sdk/lib/collection/iterable.dart +++ b/sdk/lib/collection/iterable.dart @@ -16,10 +16,6 @@ abstract class IterableMixin implements Iterable { // If changing a method here, also change the other copies. Iterable cast() => Iterable.castFrom(this); - - @Deprecated("Use cast instead.") - Iterable retype() => cast(); - Iterable map(T f(E element)) => new MappedIterable(this, f); Iterable where(bool f(E element)) => new WhereIterable(this, f); diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart index fb430a783a2..644d4b720e7 100644 --- a/sdk/lib/collection/list.dart +++ b/sdk/lib/collection/list.dart @@ -330,10 +330,6 @@ abstract class ListMixin implements List { } List cast() => List.castFrom(this); - - @Deprecated("Use cast instead.") - List retype() => cast(); - E removeLast() { if (length == 0) { throw IterableElementError.noElement(); diff --git a/sdk/lib/collection/maps.dart b/sdk/lib/collection/maps.dart index 5bc178d0a46..795a2e3cc5a 100644 --- a/sdk/lib/collection/maps.dart +++ b/sdk/lib/collection/maps.dart @@ -119,10 +119,6 @@ abstract class MapMixin implements Map { void clear(); Map cast() => Map.castFrom(this); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - void forEach(void action(K key, V value)) { for (K key in keys) { action(key, this[key]); @@ -315,10 +311,6 @@ class MapView implements Map { const MapView(Map map) : _map = map; Map cast() => _map.cast(); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - V operator [](Object key) => _map[key]; void operator []=(K key, V value) { _map[key] = value; @@ -381,7 +373,4 @@ class UnmodifiableMapView extends MapView Map cast() => new UnmodifiableMapView(_map.cast()); - - @Deprecated("Use cast instead.") - Map retype() => cast(); } diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart index 2242fb272e0..30239cb14c1 100644 --- a/sdk/lib/collection/queue.dart +++ b/sdk/lib/collection/queue.dart @@ -78,10 +78,6 @@ abstract class Queue implements EfficientLengthIterable { * this queue as well. */ Queue cast(); - - @Deprecated("Use cast instead.") - Queue retype(); - /** * Removes and returns the first element of this queue. * @@ -344,10 +340,6 @@ class DoubleLinkedQueue extends Iterable implements Queue { new DoubleLinkedQueue()..addAll(elements); Queue cast() => Queue.castFrom(this); - - @Deprecated("Use cast instead.") - Queue retype() => cast(); - int get length => _elementCount; void addLast(E value) { @@ -643,10 +635,6 @@ class ListQueue extends ListIterable implements Queue { // Iterable interface. Queue cast() => Queue.castFrom(this); - - @Deprecated("Use cast instead.") - Queue retype() => cast(); - Iterator get iterator => new _ListQueueIterator(this); void forEach(void f(E element)) { diff --git a/sdk/lib/collection/set.dart b/sdk/lib/collection/set.dart index 86e832910fe..6481a56dd93 100644 --- a/sdk/lib/collection/set.dart +++ b/sdk/lib/collection/set.dart @@ -48,10 +48,6 @@ abstract class SetMixin implements Set { bool get isNotEmpty => length != 0; Set cast() => Set.castFrom(this); - - @Deprecated("Use cast instead.") - Set retype() => cast(); - Iterable followedBy(Iterable other) => new FollowedByIterable.firstEfficient(this, other); diff --git a/sdk/lib/collection/splay_tree.dart b/sdk/lib/collection/splay_tree.dart index dce7dc5e185..b61f37a8d0c 100644 --- a/sdk/lib/collection/splay_tree.dart +++ b/sdk/lib/collection/splay_tree.dart @@ -766,10 +766,6 @@ class SplayTreeSet extends _SplayTree> new SplayTreeSet((T a, T b) => _comparator(a as E, b as E), _validKey); Set cast() => Set.castFrom(this, newSet: _newSet); - - @Deprecated("Use cast instead.") - Set retype() => cast(); - int _compare(E e1, E e2) => _comparator(e1, e2); // From Iterable. diff --git a/sdk/lib/convert/converter.dart b/sdk/lib/convert/converter.dart index 3fdcb4c7b11..e0aeeb4760d 100644 --- a/sdk/lib/convert/converter.dart +++ b/sdk/lib/convert/converter.dart @@ -65,9 +65,6 @@ abstract class Converter extends StreamTransformerBase { * are acually instances of [RT]. */ Converter cast() => Converter.castFrom(this); - - @Deprecated("Use cast instead.") - Converter retype() => cast(); } /** diff --git a/sdk/lib/core/iterable.dart b/sdk/lib/core/iterable.dart index 99361f71be5..8aaf8e6a041 100644 --- a/sdk/lib/core/iterable.dart +++ b/sdk/lib/core/iterable.dart @@ -164,10 +164,6 @@ abstract class Iterable { * the type [R], e.g., from [toList], it will have exactly the type [R]. */ Iterable cast() => Iterable.castFrom(this); - - @Deprecated("Use cast instead.") - Iterable retype() => cast(); - /** * Returns the lazy concatentation of this iterable and [other]. * diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart index bff5b31a403..3e4feae4329 100644 --- a/sdk/lib/core/list.dart +++ b/sdk/lib/core/list.dart @@ -268,10 +268,6 @@ abstract class List implements EfficientLengthIterable { * Typically implemented as `List.castFrom(this)`. */ List cast(); - - @Deprecated("Use cast instead.") - List retype(); - /** * Returns the object at the given [index] in the list * or throws a [RangeError] if [index] is out of bounds. diff --git a/sdk/lib/core/map.dart b/sdk/lib/core/map.dart index 51fda37fb60..e122688af22 100644 --- a/sdk/lib/core/map.dart +++ b/sdk/lib/core/map.dart @@ -192,10 +192,6 @@ abstract class Map { * `Map`. */ Map cast(); - - @Deprecated("Use cast instead.") - Map retype(); - /** * Returns true if this map contains the given [value]. * diff --git a/sdk/lib/core/set.dart b/sdk/lib/core/set.dart index d85ae2b497d..78f82ab2ac8 100644 --- a/sdk/lib/core/set.dart +++ b/sdk/lib/core/set.dart @@ -126,10 +126,6 @@ abstract class Set extends EfficientLengthIterable { * this set as well. */ Set cast(); - - @Deprecated("Use cast instead.") - Set retype(); - /** * Provides an iterator that iterates over the elements of this set. * diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart index a695e1f0ea9..843e633ed35 100644 --- a/sdk/lib/html/dart2js/html_dart2js.dart +++ b/sdk/lib/html/dart2js/html_dart2js.dart @@ -46684,10 +46684,6 @@ abstract class _AttributeMap extends MapBase { } Map cast() => Map.castFrom(this); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - bool containsValue(Object value) { for (var v in this.values) { if (value == v) { @@ -46849,10 +46845,6 @@ class _DataAttributeMap extends MapBase { } Map cast() => Map.castFrom(this); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - // TODO: Use lazy iterator when it is available on Map. bool containsValue(Object value) => values.any((v) => v == value); diff --git a/sdk/lib/internal/async_cast.dart b/sdk/lib/internal/async_cast.dart index eee09b95881..cb1e1128611 100644 --- a/sdk/lib/internal/async_cast.dart +++ b/sdk/lib/internal/async_cast.dart @@ -19,9 +19,6 @@ class CastStream extends Stream { } Stream cast() => new CastStream(_source); - - @Deprecated("Use cast instead.") - Stream retype() => cast(); } class CastStreamSubscription implements StreamSubscription { @@ -64,10 +61,6 @@ class CastStreamTransformer StreamTransformer cast() => new CastStreamTransformer(_source); - - @Deprecated("Use cast instead.") - StreamTransformer retype() => cast(); - Stream bind(Stream stream) => _source.bind(stream.cast()).cast(); } @@ -85,7 +78,4 @@ class CastConverter extends Converter { Converter cast() => new CastConverter(_source); - - @Deprecated("Use cast instead.") - Converter retype() => cast(); } diff --git a/sdk/lib/internal/cast.dart b/sdk/lib/internal/cast.dart index c2a6ce4f985..8d10ce462f3 100644 --- a/sdk/lib/internal/cast.dart +++ b/sdk/lib/internal/cast.dart @@ -189,10 +189,6 @@ class CastSet extends _CastIterableBase implements Set { static Set _defaultEmptySet() => new Set(); Set cast() => new CastSet(_source, _emptySet); - - @Deprecated("Use cast instead.") - Set retype() => cast(); - bool add(T value) => _source.add(value as S); void addAll(Iterable elements) { @@ -368,9 +364,6 @@ class CastQueue extends _CastIterableBase final Queue _source; CastQueue(this._source); Queue cast() => new CastQueue(_source); - - @Deprecated("Use cast instead.") - Queue retype() => cast(); } // TODO(lrn): Use when ListQueue implements List. diff --git a/tests/corelib_2/cast_test.dart b/tests/corelib_2/cast_test.dart index 552032d0698..36efe9e7531 100644 --- a/tests/corelib_2/cast_test.dart +++ b/tests/corelib_2/cast_test.dart @@ -90,7 +90,7 @@ void testList() { // Regression test. var list3 = [4, 3, 2, 1]; - var dList3 = list3.retype(); + var dList3 = list3.cast(); dList3.sort(null); Expect.listEquals([1, 2, 3, 4], list3); } diff --git a/tests/corelib_2/growable_list_test.dart b/tests/corelib_2/growable_list_test.dart index ebe04bc0116..8c3443aef11 100644 --- a/tests/corelib_2/growable_list_test.dart +++ b/tests/corelib_2/growable_list_test.dart @@ -37,9 +37,6 @@ class EfficientTestIterable extends TestIterableBase implements Set { // Avoid warnings because we don't actually implement Set. noSuchMethod(i) => super.noSuchMethod(i); Set cast() => throw "not used by test"; - - @Deprecated("Use cast instead.") - Set retype() => cast(); } class CallbackIterator implements Iterator { diff --git a/tests/corelib_2/list_unmodifiable_cast_test.dart b/tests/corelib_2/list_unmodifiable_cast_test.dart index 58815bb8257..7b5a3bcc918 100644 --- a/tests/corelib_2/list_unmodifiable_cast_test.dart +++ b/tests/corelib_2/list_unmodifiable_cast_test.dart @@ -19,11 +19,6 @@ void main() { test(new UnmodifiableListView([37]).cast()); test(new UnmodifiableListView([37]).cast()); - test(new UnmodifiableListView([37]).retype()); - test(new UnmodifiableListView([37]).retype()); - test(new UnmodifiableListView([37]).retype()); - test(new UnmodifiableListView([37]).retype()); - var m2 = new List.unmodifiable([37]); test(m2); test(m2.cast()); diff --git a/tests/corelib_2/map_unmodifiable_cast_test.dart b/tests/corelib_2/map_unmodifiable_cast_test.dart index ec5b419aabb..8e4270f0f6a 100644 --- a/tests/corelib_2/map_unmodifiable_cast_test.dart +++ b/tests/corelib_2/map_unmodifiable_cast_test.dart @@ -10,16 +10,13 @@ import 'dart:collection'; void main() { testNum(const {1: 37}, "const"); testNum(const {1: 37}.cast(), "const.cast"); - testNum(const {1: 37}.retype(), "const.retype"); testNum(new UnmodifiableMapView({1: 37}), "unmod"); testNum(new UnmodifiableMapView({1: 37}), "unmod.cast"); - testNum(new UnmodifiableMapView({1: 37}), "unmod.retype"); - testNum(new UnmodifiableMapView({1: 37}).cast(), - "unmodView.cast"); + "unmodView(num).cast"); testNum(new UnmodifiableMapView({1: 37}).cast(), - "unmodView.cast"); + "unmodView(int).cast"); testNum( new UnmodifiableMapView({1: 37}) .cast(), @@ -29,21 +26,6 @@ void main() { .cast(), "unmodView(int).cast"); - testNum( - new UnmodifiableMapView({1: 37}).retype(), - "unmodView(num).retype"); - testNum( - new UnmodifiableMapView({1: 37}).retype(), - "unmodView(int).retype"); - testNum( - new UnmodifiableMapView({1: 37}) - .retype(), - "unmodView(num).retype"); - testNum( - new UnmodifiableMapView({1: 37}) - .retype(), - "unmodView(int).retype"); - var m2 = new Map.unmodifiable({1: 37}); testNum(m2, "Map.unmod"); testNum(m2.cast(), "Map.unmod.cast"); @@ -51,7 +33,6 @@ void main() { Map nsm = new NsmMap().foo(a: 0); test(nsm, #a, 0, "nsm", noSuchMethodMap: true); test(nsm.cast(), #a, 0, "nsm.cast", noSuchMethodMap: true); - test(nsm.retype(), #a, 0, "nsm.retype", noSuchMethodMap: true); } void testNum(Map map, String name) { diff --git a/tools/dom/src/AttributeMap.dart b/tools/dom/src/AttributeMap.dart index a6e79f3be33..19c9f888f3b 100644 --- a/tools/dom/src/AttributeMap.dart +++ b/tools/dom/src/AttributeMap.dart @@ -16,10 +16,6 @@ abstract class _AttributeMap extends MapBase { } Map cast() => Map.castFrom(this); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - bool containsValue(Object value) { for (var v in this.values) { if (value == v) { @@ -181,10 +177,6 @@ class _DataAttributeMap extends MapBase { } Map cast() => Map.castFrom(this); - - @Deprecated("Use cast instead.") - Map retype() => cast(); - // TODO: Use lazy iterator when it is available on Map. bool containsValue(Object value) => values.any((v) => v == value);