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

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

Issue 1728273003: Add the @required annotation (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | no next file » | 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 694096842f918fbb5ea2ceb1865cf210dc3e95cd..71a64e67327b40e945e86b08e2088eb7a3735262 100644
--- a/pkg/meta/lib/meta.dart
+++ b/pkg/meta/lib/meta.dart
@@ -25,15 +25,31 @@ library meta;
/// or mix in `C`, either directly or indirectly. Additionally indicates that
/// `m` should only be invoked on `this`, whether explicitly or implicitly.
///
-/// Tools, such as the analyzer, can provide feedback if an invocation of a
-/// member marked as being protected is used outside of an instance member
-/// defined on a class that extends or mixes in the class in which the protected
-/// member is defined, or that uses a receiver other than `this`.
-///
-/// Tools can also provide feedback if the annotation is used on anything other
-/// than an instance member.
+/// Tools, such as the analyzer, can provide feedback if
+/// * the annotation is associated with anything other than an instance member,
+/// or
+/// * an invocation of a member marked as being protected is used outside of an
+/// instance member defined on a class that extends or mixes in the class in
+/// which the protected member is defined, or that uses a receiver other than
+/// `this`.
const _Protected protected = const _Protected();
+/// Used to annotate a named parameter `p` in a method or function `f`.
+/// Indicates that every invocation of `f` must include an argument
+/// corresponding to `p`, despite the fact that `p` would otherwise be an
+/// optional parameter.
+///
+/// Tools, such as the analyzer, can provide feedback if
+/// * the annotation is associated with anything other than a named parameter,
+/// or
+/// * an invocation of a method or function does not include an argument
+/// corresponding to a named parameter that has this annotation.
+const _Required required = const _Required();
+
class _Protected {
const _Protected();
}
+
+class _Required {
+ const _Required();
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698