Skip to content

Commit a926784

Browse files
srawlinsCommit Queue
authored andcommitted
analyzer: Improve isDeprecatedWithKind
From comments on https://dart-review.googlesource.com/c/sdk/+/450971: * Use `trackedIndirectly` on `isDeprecatedWithKind`. * In member.dart, `isDeprecatedWithKind` should just refer to `baseElement`. Change-Id: Ia58b3d84732d9bb7c2b05b8e72694e837c2feba1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451602 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent a66ef95 commit a926784

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1947,7 +1947,7 @@ abstract class ElementImpl implements Element {
19471947
}
19481948

19491949
@override
1950-
@trackedIncludedInId
1950+
@trackedIndirectly
19511951
bool isDeprecatedWithKind(String kind) => metadata.annotations
19521952
.where((e) => e.isDeprecated)
19531953
.any((e) => e.deprecationKind == kind);

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,8 @@ abstract class SubstitutedElementImpl implements Element {
252252
}
253253

254254
@override
255-
bool isDeprecatedWithKind(String kind) => metadata.annotations
256-
.where((e) => e.isDeprecated)
257-
.any((e) => e.deprecationKind == kind);
255+
bool isDeprecatedWithKind(String kind) =>
256+
baseElement.isDeprecatedWithKind(kind);
258257

259258
@override
260259
Element? thisOrAncestorMatching(bool Function(Element e) predicate) {

0 commit comments

Comments
 (0)