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

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1598773004: Do not produce hint on constructor when class is deprectated (issue 25503) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/generated/resolver_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.generated.resolver; 5 library analyzer.src.generated.resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 * @param identifier some simple identifier to check for deprecated use of 510 * @param identifier some simple identifier to check for deprecated use of
511 * @return `true` if and only if a hint code is generated on the passed node 511 * @return `true` if and only if a hint code is generated on the passed node
512 * See [HintCode.DEPRECATED_MEMBER_USE]. 512 * See [HintCode.DEPRECATED_MEMBER_USE].
513 */ 513 */
514 bool _checkForDeprecatedMemberUseAtIdentifier(SimpleIdentifier identifier) { 514 bool _checkForDeprecatedMemberUseAtIdentifier(SimpleIdentifier identifier) {
515 if (identifier.inDeclarationContext()) { 515 if (identifier.inDeclarationContext()) {
516 return false; 516 return false;
517 } 517 }
518 AstNode parent = identifier.parent; 518 AstNode parent = identifier.parent;
519 if ((parent is ConstructorName && identical(identifier, parent.name)) || 519 if ((parent is ConstructorName && identical(identifier, parent.name)) ||
520 (parent is ConstructorDeclaration &&
521 identical(identifier, parent.returnType)) ||
520 (parent is SuperConstructorInvocation && 522 (parent is SuperConstructorInvocation &&
521 identical(identifier, parent.constructorName)) || 523 identical(identifier, parent.constructorName)) ||
522 parent is HideCombinator) { 524 parent is HideCombinator) {
523 return false; 525 return false;
524 } 526 }
525 return _checkForDeprecatedMemberUse(identifier.bestElement, identifier); 527 return _checkForDeprecatedMemberUse(identifier.bestElement, identifier);
526 } 528 }
527 529
528 /** 530 /**
529 * Check for the passed binary expression for the [HintCode.DIVISION_OPTIMIZAT ION]. 531 * Check for the passed binary expression for the [HintCode.DIVISION_OPTIMIZAT ION].
(...skipping 13068 matching lines...) Expand 10 before | Expand all | Expand 10 after
13598 nonFields.add(node); 13600 nonFields.add(node);
13599 return null; 13601 return null;
13600 } 13602 }
13601 13603
13602 @override 13604 @override
13603 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); 13605 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
13604 13606
13605 @override 13607 @override
13606 Object visitWithClause(WithClause node) => null; 13608 Object visitWithClause(WithClause node) => null;
13607 } 13609 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698