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

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

Issue 2261053002: Supress deprecation warnings in a deprecated library (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: clean up Created 4 years, 4 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 | no next file » | 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/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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 /** 49 /**
50 * The class containing the AST nodes being visited, or `null` if we are not i n the scope of 50 * The class containing the AST nodes being visited, or `null` if we are not i n the scope of
51 * a class. 51 * a class.
52 */ 52 */
53 ClassElement _enclosingClass; 53 ClassElement _enclosingClass;
54 54
55 /** 55 /**
56 * A flag indicating whether a surrounding member (compilation unit or class) 56 * A flag indicating whether a surrounding member (compilation unit or class)
57 * is deprecated. 57 * is deprecated.
58 */ 58 */
59 bool inDeprecatedMember = false; 59 bool inDeprecatedMember;
60 60
61 /** 61 /**
62 * The error reporter by which errors will be reported. 62 * The error reporter by which errors will be reported.
63 */ 63 */
64 final ErrorReporter _errorReporter; 64 final ErrorReporter _errorReporter;
65 65
66 /** 66 /**
67 * The type Future<Null>, which is needed for determining whether it is safe 67 * The type Future<Null>, which is needed for determining whether it is safe
68 * to have a bare "return;" in an async method. 68 * to have a bare "return;" in an async method.
69 */ 69 */
(...skipping 11 matching lines...) Expand all
81 81
82 /** 82 /**
83 * Create a new instance of the [BestPracticesVerifier]. 83 * Create a new instance of the [BestPracticesVerifier].
84 * 84 *
85 * @param errorReporter the error reporter 85 * @param errorReporter the error reporter
86 */ 86 */
87 BestPracticesVerifier( 87 BestPracticesVerifier(
88 this._errorReporter, TypeProvider typeProvider, this._currentLibrary, 88 this._errorReporter, TypeProvider typeProvider, this._currentLibrary,
89 {TypeSystem typeSystem}) 89 {TypeSystem typeSystem})
90 : _futureNullType = typeProvider.futureNullType, 90 : _futureNullType = typeProvider.futureNullType,
91 _typeSystem = typeSystem ?? new TypeSystemImpl(); 91 _typeSystem = typeSystem ?? new TypeSystemImpl() {
92 inDeprecatedMember = _currentLibrary.isDeprecated;
93 }
92 94
93 @override 95 @override
94 Object visitAnnotation(Annotation node) { 96 Object visitAnnotation(Annotation node) {
95 if (node.elementAnnotation?.isFactory == true) { 97 if (node.elementAnnotation?.isFactory == true) {
96 AstNode parent = node.parent; 98 AstNode parent = node.parent;
97 if (parent is MethodDeclaration) { 99 if (parent is MethodDeclaration) {
98 _checkForInvalidFactory(parent); 100 _checkForInvalidFactory(parent);
99 } else { 101 } else {
100 _errorReporter 102 _errorReporter
101 .reportErrorForNode(HintCode.INVALID_FACTORY_ANNOTATION, node, []); 103 .reportErrorForNode(HintCode.INVALID_FACTORY_ANNOTATION, node, []);
(...skipping 11067 matching lines...) Expand 10 before | Expand all | Expand 10 after
11169 return null; 11171 return null;
11170 } 11172 }
11171 if (identical(node.staticElement, variable)) { 11173 if (identical(node.staticElement, variable)) {
11172 if (node.inSetterContext()) { 11174 if (node.inSetterContext()) {
11173 result = true; 11175 result = true;
11174 } 11176 }
11175 } 11177 }
11176 return null; 11178 return null;
11177 } 11179 }
11178 } 11180 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698