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

Unified Diff: pkg/analyzer/lib/src/dart/ast/ast.dart

Issue 2029193003: Report HintCode.UNUSED_FIELD for fields which are referenced in constructor field initializers. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/dart/ast/ast_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/ast/ast.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index 19ed168401d3f05d6b5b47d46315303baa059cf7..97defa61517fef5041fa2e061c9cc2750fb57ff9 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -9043,6 +9043,10 @@ class SimpleIdentifierImpl extends IdentifierImpl implements SimpleIdentifier {
return false;
}
}
+ if (parent is ConstructorFieldInitializer &&
+ identical(parent.fieldName, target)) {
+ return false;
+ }
if (parent is ForEachStatement) {
if (identical(parent.identifier, target)) {
return false;
« no previous file with comments | « no previous file | pkg/analyzer/test/dart/ast/ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698