Skip to content

Commit

Permalink
Deprecate Optional
Browse files Browse the repository at this point in the history
With the introduction of non-null by default in Dart SDK 2.12, existing
users should migrate to non-nullable types. This type will be removed in
Quiver 4.0.0.
  • Loading branch information
cbracken committed Nov 16, 2022
1 parent 1fb9dfd commit 95868c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
#### 3.2.0-dev

* Deprecate `Optional`. With the introduction of non-null by default in Dart
SDK 2.12, existing users should migrate to non-nullable types. This type
will be removed in Quiver 4.0.0.
* Expose `TreeIterator` for iterating `TreeSet` instead of using
`BidirectionalIterator`.
* Require Dart 2.17
Expand Down
4 changes: 3 additions & 1 deletion lib/src/core/optional.dart
Expand Up @@ -24,7 +24,9 @@ import 'dart:collection';
///
/// With the introduction of non-null by default in Dart SDK 2.12, developers
/// should avoid adding more uses of this type. Existing users should migrate
/// away from the `Optional` type to types marked nullable: `T?`.
/// away from the `Optional` type to types marked nullable: `T?`. This type
/// will be removed in Quiver 4.0.0.
@Deprecated('Migrate to a non-nullable type. Will be removed in 4.0.0')
class Optional<T> extends IterableBase<T> {
/// Constructs an empty Optional.
const Optional.absent() : _value = null;
Expand Down
1 change: 1 addition & 0 deletions test/core/optional_test.dart
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// ignore_for_file: deprecated_member_use_from_same_package
library quiver.core.optional_test;

import 'package:quiver/src/core/optional.dart';
Expand Down

0 comments on commit 95868c5

Please sign in to comment.