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

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

Issue 2304293002: Issue 27221. Report UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER for staticField.method() in su… (Closed)
Patch Set: Created 4 years, 3 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/static_type_warning_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/error_verifier.dart
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index abf47ca9ce73580466b2de0f6a13854fe26e50e1..6cef48a45f7632fede281791366870d3088c0f1c 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -6434,24 +6434,26 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
return true;
}
AstNode parent = identifier.parent;
- if (parent is ConstructorName ||
- parent is MethodInvocation ||
- parent is PropertyAccess ||
- parent is SuperConstructorInvocation) {
- return true;
+ if (parent is Annotation) {
+ return identical(parent.constructorName, identifier);
}
- if (parent is PrefixedIdentifier &&
- identical(parent.identifier, identifier)) {
- return true;
+ if (parent is CommentReference) {
+ return parent.newKeyword != null;
}
- if (parent is Annotation && identical(parent.constructorName, identifier)) {
- return true;
+ if (parent is ConstructorName) {
+ return identical(parent.name, identifier);
}
- if (parent is CommentReference) {
- CommentReference commentReference = parent;
- if (commentReference.newKeyword != null) {
- return true;
- }
+ if (parent is MethodInvocation) {
+ return identical(parent.methodName, identifier);
+ }
+ if (parent is PrefixedIdentifier) {
+ return identical(parent.identifier, identifier);
+ }
+ if (parent is PropertyAccess) {
+ return identical(parent.propertyName, identifier);
+ }
+ if (parent is SuperConstructorInvocation) {
+ return identical(parent.constructorName, identifier);
}
return false;
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/static_type_warning_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698