Chromium Code Reviews| Index: pkg/meta/lib/meta.dart |
| diff --git a/pkg/meta/lib/meta.dart b/pkg/meta/lib/meta.dart |
| index 984287546f6558dfa0ef1395c7950449d28d840d..9ab5e835db68021b553a6c289bfbac34ebb6d98e 100644 |
| --- a/pkg/meta/lib/meta.dart |
| +++ b/pkg/meta/lib/meta.dart |
| @@ -18,6 +18,14 @@ |
| /// in the language tour. |
| library meta; |
| +/// Used to annotate a parameter of an instance method that overrides another |
| +/// method. |
| +/// |
| +/// Indicates that this parameter may have a tighter type than the parameter on |
| +/// its superclass. The actual argument will be checked at runtime to ensure it |
| +/// is a subtype of the overridden parameter type. |
| +const _Checked checked = const _Checked(); |
| + |
| /// 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 |
| @@ -97,6 +105,21 @@ const _Protected protected = const _Protected(); |
| /// corresponding to a named parameter that has this annotation. |
| const Required required = const Required(); |
| +/// Used to annotate a field that is allowed to be overridden in Strong Mode. |
| +const _Virtual virtual = const _Virtual(); |
|
Alexei Diaz
2016/10/13 16:36:58
Could this somehow be extended to methods? Like th
Brian Wilkerson
2016/10/13 18:17:00
This annotation (which wasn't added by this CL, me
|
| + |
| +/// Used to annotate an instance member that was made public so that it could be |
| +/// overridden but that is not intended to be referenced from outside the |
| +/// defining library. |
| +/// |
| +/// Tools, such as the analyzer, can provide feedback if |
| +/// |
| +/// * the annotation is associated with a declaration other than a public |
| +/// instance member in a class, or |
| +/// * the member is referenced outside of the defining library. |
| +const _VisibleForOverriding visibleForOverriding = |
| + const _VisibleForOverriding(); |
| + |
| /// Used to annotate a declaration was made public, so that it is more visible |
| /// than otherwise necessary, to make code testable. |
| /// |
| @@ -128,17 +151,6 @@ class Required { |
| const Required([this.reason]); |
| } |
| -/// Used to annotate a parameter of an instance method that overrides another |
| -/// method. |
| -/// |
| -/// Indicates that this parameter may have a tighter type than the parameter on |
| -/// its superclass. The actual argument will be checked at runtime to ensure it |
| -/// is a subtype of the overridden parameter type. |
| -const _Checked checked = const _Checked(); |
| - |
| -/// Used to annotate a field is allowed to be overridden in Strong Mode. |
| -const _Virtual virtual = const _Virtual(); |
| - |
| class _Checked { |
| const _Checked(); |
| } |
| @@ -167,6 +179,10 @@ class _Virtual { |
| const _Virtual(); |
| } |
| +class _VisibleForOverriding { |
| + const _VisibleForOverriding(); |
| +} |
| + |
| class _VisibleForTesting { |
| const _VisibleForTesting(); |
| } |