Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1749753002: Fix bug when @protected is not on a class member (issue 25882) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index bd6682bcbb1d65c3acdcc65a0a3cf5504f15cf0e..8567a02420faa500286742aa057e985c4e98341e 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -652,11 +652,9 @@ class BestPracticesVerifier extends RecursiveAstVisitor<Object> {
}
Element element = identifier.bestElement;
if (element is PropertyAccessorElement &&
+ element.enclosingElement is ClassElement &&
(element.isProtected || element.variable.isProtected)) {
ClassElement definingClass = element.enclosingElement;
- if (definingClass == null) {
- return;
- }
ClassDeclaration accessingClass =
identifier.getAncestor((AstNode node) => node is ClassDeclaration);
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698