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

Unified Diff: pkg/meta/lib/meta.dart

Issue 2789843003: Add an experimental annotation (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/meta/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/meta/lib/meta.dart
diff --git a/pkg/meta/lib/meta.dart b/pkg/meta/lib/meta.dart
index 44f71b87890c4e777a3ba50614fe97b929ad0764..4b932780df1fac02a4111cab28cb4a37f984c7aa 100644
--- a/pkg/meta/lib/meta.dart
+++ b/pkg/meta/lib/meta.dart
@@ -26,6 +26,28 @@ library meta;
/// is a subtype of the overridden parameter type.
const _Checked checked = const _Checked();
+/// Used to annotate a library, or any declaration that is part of the public
+/// interface of a library (such as top-level members, class members, and
+/// function parameters) to indicate that the annotated API is experimental and
+/// may be removed or changed at any-time without updating the version of the
+/// containing package, despite the fact that it would otherwise be a breaking
+/// change.
+///
+/// If the annotation is applied to a library then it is equivalent to applying
+/// the annotation to all of the top-level members of the library. Applying the
+/// annotation to a class does *not* apply the annotation to subclasses, but
+/// does apply the annotation to members of the class.
+///
+/// Tools, such as the analyzer, can provide feedback if
+///
+/// * the annotation is associated with a declaration that is not part of the
+/// public interface of a library (such as a local variable or a declaration
+/// that is private) or a directive other than the first directive in the
+/// library, or
+/// * the declaration is referenced by a package that has not explicitly
+/// indicated its intention to use experimental APIs (details TBD).
+const _Experimental experimental = const _Experimental();
+
/// Used to annotate an instance or static method `m`. Indicates that `m` must
/// either be abstract or must return a newly allocated object or `null`. In
/// addition, every method that either implements or overrides `m` is implicitly
@@ -138,8 +160,7 @@ const _VisibleForOverriding visibleForOverriding =
/// Tools, such as the analyzer, can provide feedback if
///
/// * the annotation is associated with a declaration not in the `lib` folder
-/// of a package;
-/// or
+/// of a package, or
/// * the declaration is referenced outside of its the defining library or a
/// library which is in the `test` folder of the defining package.
const _VisibleForTesting visibleForTesting = const _VisibleForTesting();
@@ -178,6 +199,10 @@ class _Checked {
const _Checked();
}
+class _Experimental {
+ const _Experimental();
+}
+
class _Factory {
const _Factory();
}
« no previous file with comments | « no previous file | pkg/meta/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698