Skip to content

Commit

Permalink
Simplify _InvalidAccessVerifier._hasTypeOrSuperType().
Browse files Browse the repository at this point in the history
[email protected]

Change-Id: I4855170939bf8dc89afdc3dd4d7a91c4819e5667
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153948
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
  • Loading branch information
scheglov authored and [email protected] committed Jul 10, 2020
1 parent e52a8be commit 5c1eee9
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions pkg/analyzer/lib/src/error/best_practices_verifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1609,18 +1609,7 @@ class _InvalidAccessVerifier {
if (element == null) {
return false;
}
if (element == superElement) {
return true;
}
// TODO(scheglov) `allSupertypes` is very expensive
var allSupertypes = element.allSupertypes;
for (var i = 0; i < allSupertypes.length; i++) {
var supertype = allSupertypes[i];
if (supertype.element == superElement) {
return true;
}
}
return false;
return element.thisType.asInstanceOf(superElement) != null;
}

bool _hasVisibleForTemplate(Element element) {
Expand Down

0 comments on commit 5c1eee9

Please sign in to comment.