[3.0 alpha] Remove deprecated BidirectionalIterator.

Requires releasing `package:quiver` 3.2.0 so Flutter can upgrade to that.


Change-Id: Ibd9acc5fa11a67ca50d06172dfe0f9175b240522
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276741
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This commit is contained in:
Lasse R.H. Nielsen 2023-01-02 16:14:08 +00:00 committed by Commit Queue
parent e42bb83d32
commit 81b137d8fe
11 changed files with 14 additions and 29 deletions

View file

@ -30,6 +30,9 @@
ways instead, possibly with a StackOverflowError.
- Removed the deprecated [`NoSuchMethodError`][] default constructor.
Use the [`NoSuchMethodError.withInvocation`][] named constructor instead.
- Removed the deprecated [`BidirectionalIterator`][] class.
Existing bidirectional iterators can still work, they just don't have
a shared supertype locking them to a specific name for moving backwards.
[#49529]: https://github.com/dart-lang/sdk/issues/49529
[`List.filled`]: https://api.dart.dev/stable/2.18.6/dart-core/List/List.filled.html
@ -54,6 +57,7 @@
[`NullThrownError`]: https://api.dart.dev/dev/2.19.0-430.0.dev/dart-core/NullThrownError-class.html
[`AbstractClassInstantiationError`]: https://api.dart.dev/stable/2.18.3/dart-core/AbstractClassInstantiationError-class.html
[`CyclicInitializationError`]: https://api.dart.dev/dev/2.19.0-430.0.dev/dart-core/CyclicInitializationError-class.html
[`BidirectionalIterator`]: https://api.dart.dev/dev/2.19.0-430.0.dev/dart-core/BidirectionalIterator-class.html
#### `dart:async`
@ -68,7 +72,7 @@
#### `dart:developer`
- **Breaking change** [#49529][]:
- Removed the deprecated [`MAX_USER_TAGS`][] constant.
- Removed the deprecated [`MAX_USER_TAGS`][] constant.
Use [`maxUserTags`][] instead.
- Callbacks passed to `registerExtension` will be run in the zone from which
they are registered.

View file

@ -121,7 +121,6 @@ additionalExports = (core::Deprecated,
core::int,
core::Invocation,
core::Iterable,
core::BidirectionalIterator,
core::Iterator,
core::List,
core::Map,

View file

@ -117,7 +117,6 @@ additionalExports = (core::Deprecated,
core::int,
core::Invocation,
core::Iterable,
core::BidirectionalIterator,
core::Iterator,
core::List,
core::Map,

View file

@ -121,7 +121,6 @@ additionalExports = (core::Deprecated,
core::int,
core::Invocation,
core::Iterable,
core::BidirectionalIterator,
core::Iterator,
core::List,
core::Map,

View file

@ -56,7 +56,6 @@ additionalExports = (core::Deprecated,
core::int,
core::Invocation,
core::Iterable,
core::BidirectionalIterator,
core::Iterator,
core::List,
core::Map,

View file

@ -117,7 +117,6 @@ additionalExports = (core::Deprecated,
core::int,
core::Invocation,
core::Iterable,
core::BidirectionalIterator,
core::Iterator,
core::List,
core::Map,

View file

@ -11,7 +11,6 @@ additionalExports = (asy::Future,
core::Comparator,
core::ArgumentError,
core::AssertionError,
core::BidirectionalIterator,
core::BigInt,
core::Comparable,
core::ConcurrentModificationError,

View file

@ -11,7 +11,6 @@ additionalExports = (asy::Future,
core::Comparator,
core::ArgumentError,
core::AssertionError,
core::BidirectionalIterator,
core::BigInt,
core::Comparable,
core::ConcurrentModificationError,

View file

@ -1394,7 +1394,6 @@ void visitCompilationUnit(
(classElement.name == 'StackTrace') ||
(classElement.name == 'NoSuchMethodError') ||
(classElement.name == 'Comparable') ||
(classElement.name == 'BidirectionalIterator') ||
(classElement.name == 'Iterator') ||
(classElement.name == 'Stopwatch') ||
(classElement.name == 'Finalizer') ||

View file

@ -822,22 +822,3 @@ class _GeneratorIterable<E> extends ListIterable<E> {
/// Helper function used as default _generator function.
static int _id(int n) => n;
}
/// An [Iterator] that allows moving backwards as well as forwards.
///
/// Deprecation note: This interface has turned out to not be
/// valuable as a general reusable interface. There is still only
/// one class implementing it, [RuneIterator], and at least one other
/// bidirectional iterator preferred a different name than `movePrevious`
/// for the other direction.
/// As such, this interface does not carry its own weight, and will be
/// removed in a later release.
@Deprecated("Use the implementing class directly")
abstract class BidirectionalIterator<E> implements Iterator<E> {
/// Move back to the previous element.
///
/// Returns true and updates [current] if successful. Returns false
/// and updates [current] to an implementation defined state if there is no
/// previous element
bool movePrevious();
}

View file

@ -799,7 +799,7 @@ int _combineSurrogatePair(int start, int end) {
}
/// [Iterator] for reading runes (integer Unicode code points) of a Dart string.
class RuneIterator implements BidirectionalIterator<int> {
class RuneIterator implements Iterator<int> {
/// String being iterated.
final String string;
@ -906,6 +906,10 @@ class RuneIterator implements BidirectionalIterator<int> {
return string.substring(_position, _nextPosition);
}
/// Move to the next code point.
///
/// Returns `true` and updates [current] if there is a next code point.
/// Returns `false` otherwise, and then there is no current code point.
bool moveNext() {
_position = _nextPosition;
if (_position == string.length) {
@ -927,6 +931,10 @@ class RuneIterator implements BidirectionalIterator<int> {
return true;
}
/// Move back to the previous code point.
///
/// Returns `true` and updates [current] if there is a previous code point.
/// Returns `false` otherwise, and then there is no current code point.
bool movePrevious() {
_nextPosition = _position;
if (_position == 0) {