From 42f295ece52db767c22c902761bbae9d0fcd3dab Mon Sep 17 00:00:00 2001 From: "Lasse R.H. Nielsen" Date: Fri, 17 Aug 2018 07:55:12 +0000 Subject: [PATCH] Deprecate `provisional` and `Provisional` and make them unusable. Will be removed in Dart 3. Change-Id: I0bf8b01f23bab5a7871f0562562b7ad98887394f Reviewed-on: https://dart-review.googlesource.com/69462 Reviewed-by: Leaf Petersen Commit-Queue: Lasse R.H. Nielsen --- CHANGELOG.md | 5 ++++ sdk/lib/cli/wait_for.dart | 1 - sdk/lib/core/annotations.dart | 54 +++++++---------------------------- 3 files changed, 15 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7376946270..b5a6ea7a7a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ ### Core library changes +#### `dart:core`: +* Deprecated the `provisional` annotation and the `Provisional` + annotation class. These should have been removed before releasing Dart 2.0, + and they have no effect. + ## 2.1.0-dev.1.0 ### Tool Changes diff --git a/sdk/lib/cli/wait_for.dart b/sdk/lib/cli/wait_for.dart index ad1f8fe45f0..1886ff19fac 100644 --- a/sdk/lib/cli/wait_for.dart +++ b/sdk/lib/cli/wait_for.dart @@ -111,7 +111,6 @@ class _WaitForUtils { * subsequent calls block waiting for a condition that is only satisfied when * an earlier call returns. */ -@provisional T waitFor(Future future, {Duration timeout}) { T result; bool futureCompleted = false; diff --git a/sdk/lib/core/annotations.dart b/sdk/lib/core/annotations.dart index 08e6c7aa3b4..f1c806ac20c 100644 --- a/sdk/lib/core/annotations.dart +++ b/sdk/lib/core/annotations.dart @@ -109,57 +109,23 @@ class _Override { const Object override = const _Override(); /** - * The annotation `@Provisional('message')` marks a feature as provisional. + * An annotation class that was used during development of Dart 2. * - * An API is considered to be provisional if it is still going through the - * process of stabilizing and is subject to change or removal. - * - * The intent of the `@Provisional` annotation is to mark APIs that are still in - * development or that are added only tentatively. Adding the API allows users - * to experiment with using the APIs, which can provide valuable feedback. Such - * provisional APIs do not promise stability. They can be changed or removed - * without warning. - * - * The `@Provisional` annotation applies to: - * - library directives, - * - public top-level declarations, and - * - public members of public classes. - * - * Provisionality is transitive: - * - If a library is provisional, so is every member of it. - * - If a class is provisional, so is every member of it. - * - If a variable is provisional, so are its implicit getter and setter. - * - * Further, if a class is provisional, so are classes that extend, implement, - * and mix-in the class. - * - * A tool that processes Dart source code may report when: - * - the code imports a provisional library. - * - the code exports a provisional library, or any provisional member of - *  a non-provisional library. - * - the code refers statically to a provisional declaration. - * - the code dynamically uses a member of an object with a statically known - * type, where the member is provisional on the static type of the object. - * - * If the provisional use is inside a library, class or method which is itself - * provisional, the tool should not bother the user about it. - * A provisional feature is expected to use other provisional features. + * Should not be used any more. */ +@deprecated class Provisional { - /** - * A brief message describing how or why the feature is provisional. - */ - final String message; - - const Provisional({String message}) - : this.message = message ?? "Subject to change or removal."; + String get message => null; + const Provisional({String message}); } /** - * Marks a feature as provisional with the message "Subject to change or - * removal". + * An annotation that was used during development of Dart 2. + * + * Should not be used any more. */ -const Provisional provisional = const Provisional(); +@deprecated +const Null provisional = null; class _Proxy { const _Proxy();