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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/dart/ast/ast_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.dart.ast.ast; 5 library analyzer.src.dart.ast.ast;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 9025 matching lines...) Expand 10 before | Expand all | Expand 10 after
9036 if (parent is Label) { 9036 if (parent is Label) {
9037 return false; 9037 return false;
9038 } 9038 }
9039 // analyze usage 9039 // analyze usage
9040 if (parent is AssignmentExpression) { 9040 if (parent is AssignmentExpression) {
9041 if (identical(parent.leftHandSide, target) && 9041 if (identical(parent.leftHandSide, target) &&
9042 parent.operator.type == TokenType.EQ) { 9042 parent.operator.type == TokenType.EQ) {
9043 return false; 9043 return false;
9044 } 9044 }
9045 } 9045 }
9046 if (parent is ConstructorFieldInitializer &&
9047 identical(parent.fieldName, target)) {
9048 return false;
9049 }
9046 if (parent is ForEachStatement) { 9050 if (parent is ForEachStatement) {
9047 if (identical(parent.identifier, target)) { 9051 if (identical(parent.identifier, target)) {
9048 return false; 9052 return false;
9049 } 9053 }
9050 } 9054 }
9051 return true; 9055 return true;
9052 } 9056 }
9053 9057
9054 @override 9058 @override
9055 bool inSetterContext() { 9059 bool inSetterContext() {
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after
11039 11043
11040 @override 11044 @override
11041 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => 11045 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) =>
11042 visitor.visitYieldStatement(this); 11046 visitor.visitYieldStatement(this);
11043 11047
11044 @override 11048 @override
11045 void visitChildren(AstVisitor visitor) { 11049 void visitChildren(AstVisitor visitor) {
11046 _expression?.accept(visitor); 11050 _expression?.accept(visitor);
11047 } 11051 }
11048 } 11052 }
OLDNEW
« 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