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

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

Issue 2078493002: Don't flag improper @protected access in docs (#26713). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 889e1567a9545651566716b420daca59a689fe76..feb67bb5dcc483c80bc2646786e7d54c7ffce9a3 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -697,8 +697,12 @@ class BestPracticesVerifier extends RecursiveAstVisitor<Object> {
return false;
}
+ bool inCommentReference(SimpleIdentifier identifier) =>
+ identifier.getAncestor((AstNode node) => node is CommentReference) !=
+ null;
+
Element element = identifier.bestElement;
- if (isProtected(element)) {
+ if (isProtected(element) && !inCommentReference(identifier)) {
ClassElement definingClass = element.enclosingElement;
ClassDeclaration accessingClass =
identifier.getAncestor((AstNode node) => node is ClassDeclaration);
@@ -2049,8 +2053,8 @@ class DeadCodeVerifier extends RecursiveAstVisitor<Object> {
* This allows for a final break, continue, return, or throw statement
* at the end of a switch case, that are mandated by the language spec.
*/
- void _checkForDeadStatementsInNodeList(
- NodeList<Statement> statements, {bool allowMandated: false}) {
+ void _checkForDeadStatementsInNodeList(NodeList<Statement> statements,
+ {bool allowMandated: false}) {
bool statementExits(Statement statement) {
if (statement is BreakStatement) {
return statement.label == null;
« 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