mirror of
https://github.com/dart-lang/sdk
synced 2024-10-04 16:44:59 +00:00
Add @redeclare
See: https://github.com/dart-lang/sdk/issues/53121 Change-Id: I812bc49b58cdf15e9c0c8bcc62a846b51f5dff70 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319100 Commit-Queue: Phil Quitslund <pquitslund@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
061396f38d
commit
98070ec188
|
@ -268,6 +268,18 @@ const _OptionalTypeArgs optionalTypeArgs = _OptionalTypeArgs();
|
|||
// "referenced."
|
||||
const _Protected protected = _Protected();
|
||||
|
||||
/// Used to annotate an instance member of an extension type that
|
||||
/// redeclares a member from a superinterface.
|
||||
///
|
||||
/// Tools, such as the analyzer, can provide feedback if
|
||||
///
|
||||
/// * the annotation is associated with anything other than a valid instance
|
||||
/// member of an extension type (a method, operator, getter, or setter) or
|
||||
/// * is applied to a member that does not redeclare a member from either the
|
||||
/// extended type or a superinterface.
|
||||
@experimental
|
||||
const _Redeclare redeclare = _Redeclare();
|
||||
|
||||
/// Annotation for intentionally loosening restrictions on subtyping that would
|
||||
/// otherwise cause lint warnings to be produced by the `implicit_reopen` lint.
|
||||
///
|
||||
|
@ -519,6 +531,16 @@ class _Protected {
|
|||
const _Protected();
|
||||
}
|
||||
|
||||
@Target({
|
||||
// todo(pq): restrict to instance members only
|
||||
TargetKind.getter,
|
||||
TargetKind.setter,
|
||||
TargetKind.method,
|
||||
})
|
||||
class _Redeclare {
|
||||
const _Redeclare();
|
||||
}
|
||||
|
||||
@Target({
|
||||
TargetKind.classType,
|
||||
TargetKind.mixinType,
|
||||
|
|
Loading…
Reference in a new issue