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

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

Issue 2100493002: Allow for library access to `@protected` protected members (linter#254). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge branch 'master' into protected Created 4 years, 6 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/hint_code_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 474642ae4338266461ab1140774d7ff043a4056b..958c65e8782cdba5b5f8a7480f3c7fd110025707 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -753,8 +753,13 @@ class BestPracticesVerifier extends RecursiveAstVisitor<Object> {
identifier.getAncestor((AstNode node) => node is CommentReference) !=
null;
+ bool inCurrentLibrary(Element element) =>
+ element.library == _currentLibrary;
+
Element element = identifier.bestElement;
- if (isProtected(element) && !inCommentReference(identifier)) {
+ if (isProtected(element) &&
+ !inCurrentLibrary(element) &&
+ !inCommentReference(identifier)) {
ClassElement definingClass = element.enclosingElement;
ClassDeclaration accessingClass =
identifier.getAncestor((AstNode node) => node is ClassDeclaration);
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/hint_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698