Skip to content

Commit e00cdc8

Browse files
bwilkersonCommit Queue
authored andcommitted
Remove the methods now in Metadata from Annotatable
It turned out to be a relatively small change to delete the methods, so I did them all in one CL. Change-Id: I56bfd39c41fe2991b54d392977e4439ecca698f6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390586 Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent 8f6f186 commit e00cdc8

File tree

12 files changed

+38
-320
lines changed

12 files changed

+38
-320
lines changed

pkg/analysis_server/lib/src/computer/computer_outline.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ class _FunctionBodyOutlinesVisitor extends RecursiveAstVisitor<void> {
461461
/// Return `true` if the given [element] is the method 'group' defined in the
462462
/// test package.
463463
bool isGroup(engine.ExecutableElement2? element) {
464-
if (element != null && element.hasIsTestGroup) {
464+
if (element != null && element.metadata2.hasIsTestGroup) {
465465
return true;
466466
}
467467
return element is engine.TopLevelFunctionElement &&
@@ -472,7 +472,7 @@ class _FunctionBodyOutlinesVisitor extends RecursiveAstVisitor<void> {
472472
/// Return `true` if the given [element] is the method 'test' defined in the
473473
/// test package.
474474
bool isTest(engine.ExecutableElement2? element) {
475-
if (element != null && element.hasIsTest) {
475+
if (element != null && element.metadata2.hasIsTest) {
476476
return true;
477477
}
478478
return element is engine.TopLevelFunctionElement &&

pkg/analyzer/lib/dart/element/element2.dart

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -90,90 +90,6 @@ abstract class Annotatable {
9090
/// Returns `null` if the receiver doesn't have documentation.
9191
String? get documentationComment;
9292

93-
/// Whether the receiver has an annotation of the form `@alwaysThrows`.
94-
bool get hasAlwaysThrows;
95-
96-
/// Whether the receiver has an annotation of the form `@deprecated`
97-
/// or `@Deprecated('..')`.
98-
bool get hasDeprecated;
99-
100-
/// Whether the receiver has an annotation of the form `@doNotStore`.
101-
bool get hasDoNotStore;
102-
103-
/// Whether the receiver has an annotation of the form `@doNotSubmit`.
104-
bool get hasDoNotSubmit;
105-
106-
/// Whether the receiver has an annotation of the form `@factory`.
107-
bool get hasFactory;
108-
109-
/// Whether the receiver has an annotation of the form `@immutable`.
110-
bool get hasImmutable;
111-
112-
/// Whether the receiver has an annotation of the form `@internal`.
113-
bool get hasInternal;
114-
115-
/// Whether the receiver has an annotation of the form `@isTest`.
116-
bool get hasIsTest;
117-
118-
/// Whether the receiver has an annotation of the form `@isTestGroup`.
119-
bool get hasIsTestGroup;
120-
121-
/// Whether the receiver has an annotation of the form `@JS(..)`.
122-
bool get hasJS;
123-
124-
/// Whether the receiver has an annotation of the form `@literal`.
125-
bool get hasLiteral;
126-
127-
/// Whether the receiver has an annotation of the form `@mustBeConst`.
128-
bool get hasMustBeConst;
129-
130-
/// Whether the receiver has an annotation of the form `@mustBeOverridden`.
131-
bool get hasMustBeOverridden;
132-
133-
/// Whether the receiver has an annotation of the form `@mustCallSuper`.
134-
bool get hasMustCallSuper;
135-
136-
/// Whether the receiver has an annotation of the form `@nonVirtual`.
137-
bool get hasNonVirtual;
138-
139-
/// Whether the receiver has an annotation of the form `@optionalTypeArgs`.
140-
bool get hasOptionalTypeArgs;
141-
142-
/// Whether the receiver has an annotation of the form `@override`.
143-
bool get hasOverride;
144-
145-
/// Whether the receiver has an annotation of the form `@protected`.
146-
bool get hasProtected;
147-
148-
/// Whether the receiver has an annotation of the form `@redeclare`.
149-
bool get hasRedeclare;
150-
151-
/// Whether the receiver has an annotation of the form `@reopen`.
152-
bool get hasReopen;
153-
154-
/// Whether the receiver has an annotation of the form `@required`.
155-
bool get hasRequired;
156-
157-
/// Whether the receiver has an annotation of the form `@sealed`.
158-
bool get hasSealed;
159-
160-
/// Whether the receiver has an annotation of the form `@useResult`
161-
/// or `@UseResult('..')`.
162-
bool get hasUseResult;
163-
164-
/// Whether the receiver has an annotation of the form `@visibleForOverriding`.
165-
bool get hasVisibleForOverriding;
166-
167-
/// Whether the receiver has an annotation of the form `@visibleForTemplate`.
168-
bool get hasVisibleForTemplate;
169-
170-
/// Whether the receiver has an annotation of the form `@visibleForTesting`.
171-
bool get hasVisibleForTesting;
172-
173-
/// Whether the receiver has an annotation of the form
174-
/// `@visibleOutsideTemplate`.
175-
bool get hasVisibleOutsideTemplate;
176-
17793
/// The metadata associated with the element or fragment.
17894
///
17995
/// If the receiver is an element that has fragments, the list will include
@@ -182,23 +98,6 @@ abstract class Annotatable {
18298
/// The list will be empty if the receiver does not have any metadata or if
18399
/// the library containing this element has not yet been fully resolved.
184100
Metadata get metadata2;
185-
186-
/// The version where this SDK API was added.
187-
///
188-
/// A `@Since()` annotation can be applied to a library declaration,
189-
/// any public declaration in a library, or in a class, or to an optional
190-
/// parameter, etc.
191-
///
192-
/// The returned version is "effective", so that if a library is annotated
193-
/// then all elements of the library inherit it; or if a class is annotated
194-
/// then all members and constructors of the class inherit it.
195-
///
196-
/// If multiple `@Since()` annotations apply to the same element, the latest
197-
/// version takes precedence.
198-
///
199-
/// Returns `null` if the element is not declared in the SDK, or doesn't have
200-
/// a `@Since()` annotation applied to it.
201-
Version? get sinceSdkVersion;
202101
}
203102

204103
abstract class BindPatternVariableElement2 implements PatternVariableElement2 {}

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 0 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -6640,91 +6640,9 @@ class LocalFunctionElementImpl extends ExecutableElementImpl2
66406640
.map((fragment) => fragment.element)
66416641
.toList();
66426642

6643-
@override
6644-
bool get hasAlwaysThrows => _wrappedElement.hasAlwaysThrows;
6645-
6646-
@override
6647-
bool get hasDeprecated => _wrappedElement.hasDeprecated;
6648-
6649-
@override
6650-
bool get hasDoNotStore => _wrappedElement.hasDoNotStore;
6651-
6652-
@override
6653-
bool get hasDoNotSubmit => _wrappedElement.hasDoNotSubmit;
6654-
6655-
@override
6656-
bool get hasFactory => _wrappedElement.hasFactory;
6657-
6658-
@override
6659-
bool get hasImmutable => _wrappedElement.hasImmutable;
6660-
66616643
@override
66626644
bool get hasImplicitReturnType => _wrappedElement.hasImplicitReturnType;
66636645

6664-
@override
6665-
bool get hasInternal => _wrappedElement.hasInternal;
6666-
6667-
@override
6668-
bool get hasIsTest => _wrappedElement.hasIsTest;
6669-
6670-
@override
6671-
bool get hasIsTestGroup => _wrappedElement.hasIsTestGroup;
6672-
6673-
@override
6674-
bool get hasJS => _wrappedElement.hasJS;
6675-
6676-
@override
6677-
bool get hasLiteral => _wrappedElement.hasLiteral;
6678-
6679-
@override
6680-
bool get hasMustBeConst => _wrappedElement.hasMustBeConst;
6681-
6682-
@override
6683-
bool get hasMustBeOverridden => _wrappedElement.hasMustBeOverridden;
6684-
6685-
@override
6686-
bool get hasMustCallSuper => _wrappedElement.hasMustCallSuper;
6687-
6688-
@override
6689-
bool get hasNonVirtual => _wrappedElement.hasNonVirtual;
6690-
6691-
@override
6692-
bool get hasOptionalTypeArgs => _wrappedElement.hasOptionalTypeArgs;
6693-
6694-
@override
6695-
bool get hasOverride => _wrappedElement.hasOverride;
6696-
6697-
@override
6698-
bool get hasProtected => _wrappedElement.hasProtected;
6699-
6700-
@override
6701-
bool get hasRedeclare => _wrappedElement.hasRedeclare;
6702-
6703-
@override
6704-
bool get hasReopen => _wrappedElement.hasReopen;
6705-
6706-
@override
6707-
bool get hasRequired => _wrappedElement.hasRequired;
6708-
6709-
@override
6710-
bool get hasSealed => _wrappedElement.hasSealed;
6711-
6712-
@override
6713-
bool get hasUseResult => _wrappedElement.hasUseResult;
6714-
6715-
@override
6716-
bool get hasVisibleForOverriding => _wrappedElement.hasVisibleForOverriding;
6717-
6718-
@override
6719-
bool get hasVisibleForTemplate => _wrappedElement.hasVisibleForTemplate;
6720-
6721-
@override
6722-
bool get hasVisibleForTesting => _wrappedElement.hasVisibleForTesting;
6723-
6724-
@override
6725-
bool get hasVisibleOutsideTemplate =>
6726-
_wrappedElement.hasVisibleOutsideTemplate;
6727-
67286646
@override
67296647
bool get isAbstract => _wrappedElement.isAbstract;
67306648

@@ -6749,9 +6667,6 @@ class LocalFunctionElementImpl extends ExecutableElementImpl2
67496667
@override
67506668
DartType get returnType => _wrappedElement.returnType;
67516669

6752-
@override
6753-
Version? get sinceSdkVersion => _wrappedElement.sinceSdkVersion;
6754-
67556670
@override
67566671
FunctionType get type => _wrappedElement.type;
67576672

@@ -7080,87 +6995,6 @@ mixin MaybeAugmentedInstanceElementMixin
70806995
.nonNulls
70816996
.toList();
70826997

7083-
@override
7084-
bool get hasAlwaysThrows => declaration.hasAlwaysThrows;
7085-
7086-
@override
7087-
bool get hasDeprecated => declaration.hasDeprecated;
7088-
7089-
@override
7090-
bool get hasDoNotStore => declaration.hasDoNotStore;
7091-
7092-
@override
7093-
bool get hasDoNotSubmit => declaration.hasDoNotSubmit;
7094-
7095-
@override
7096-
bool get hasFactory => declaration.hasFactory;
7097-
7098-
@override
7099-
bool get hasImmutable => declaration.hasImmutable;
7100-
7101-
@override
7102-
bool get hasInternal => declaration.hasInternal;
7103-
7104-
@override
7105-
bool get hasIsTest => declaration.hasIsTest;
7106-
7107-
@override
7108-
bool get hasIsTestGroup => declaration.hasIsTestGroup;
7109-
7110-
@override
7111-
bool get hasJS => declaration.hasJS;
7112-
7113-
@override
7114-
bool get hasLiteral => declaration.hasLiteral;
7115-
7116-
@override
7117-
bool get hasMustBeConst => declaration.hasMustBeConst;
7118-
7119-
@override
7120-
bool get hasMustBeOverridden => declaration.hasMustBeOverridden;
7121-
7122-
@override
7123-
bool get hasMustCallSuper => declaration.hasMustCallSuper;
7124-
7125-
@override
7126-
bool get hasNonVirtual => declaration.hasNonVirtual;
7127-
7128-
@override
7129-
bool get hasOptionalTypeArgs => declaration.hasOptionalTypeArgs;
7130-
7131-
@override
7132-
bool get hasOverride => declaration.hasOverride;
7133-
7134-
@override
7135-
bool get hasProtected => declaration.hasProtected;
7136-
7137-
@override
7138-
bool get hasRedeclare => declaration.hasRedeclare;
7139-
7140-
@override
7141-
bool get hasReopen => declaration.hasReopen;
7142-
7143-
@override
7144-
bool get hasRequired => declaration.hasRequired;
7145-
7146-
@override
7147-
bool get hasSealed => declaration.hasSealed;
7148-
7149-
@override
7150-
bool get hasUseResult => declaration.hasUseResult;
7151-
7152-
@override
7153-
bool get hasVisibleForOverriding => declaration.hasVisibleForOverriding;
7154-
7155-
@override
7156-
bool get hasVisibleForTemplate => declaration.hasVisibleForTemplate;
7157-
7158-
@override
7159-
bool get hasVisibleForTesting => declaration.hasVisibleForTesting;
7160-
7161-
@override
7162-
bool get hasVisibleOutsideTemplate => declaration.hasVisibleOutsideTemplate;
7163-
71646998
@override
71656999
int get id => declaration.id;
71667000

@@ -7215,9 +7049,6 @@ mixin MaybeAugmentedInstanceElementMixin
72157049
.nonNulls
72167050
.toList();
72177051

7218-
@override
7219-
Version? get sinceSdkVersion => declaration.sinceSdkVersion;
7220-
72217052
@override
72227053
List<TypeParameterElement2> get typeParameters2 => declaration.typeParameters
72237054
.map((fragment) => (fragment as TypeParameterFragment).element)

0 commit comments

Comments
 (0)