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

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

Issue 2314963002: Remove the final error being generated in a scope (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 unified diff | Download patch
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 7727 matching lines...) Expand 10 before | Expand all | Expand 10 after
7738 * [nameScope] is the scope used to resolve identifiers in the node that will 7738 * [nameScope] is the scope used to resolve identifiers in the node that will
7739 * first be visited. If `null` or unspecified, a new [LibraryScope] will be 7739 * first be visited. If `null` or unspecified, a new [LibraryScope] will be
7740 * created based on [definingLibrary] and [typeProvider]. 7740 * created based on [definingLibrary] and [typeProvider].
7741 */ 7741 */
7742 ScopedVisitor(this.definingLibrary, Source source, this.typeProvider, 7742 ScopedVisitor(this.definingLibrary, Source source, this.typeProvider,
7743 AnalysisErrorListener errorListener, 7743 AnalysisErrorListener errorListener,
7744 {Scope nameScope}) 7744 {Scope nameScope})
7745 : source = source, 7745 : source = source,
7746 errorReporter = new ErrorReporter(errorListener, source) { 7746 errorReporter = new ErrorReporter(errorListener, source) {
7747 if (nameScope == null) { 7747 if (nameScope == null) {
7748 this.nameScope = new LibraryScope(definingLibrary, errorListener); 7748 this.nameScope = new LibraryScope(definingLibrary);
7749 } else { 7749 } else {
7750 this.nameScope = nameScope; 7750 this.nameScope = nameScope;
7751 } 7751 }
7752 } 7752 }
7753 7753
7754 /** 7754 /**
7755 * Return the implicit label scope in which the current node is being 7755 * Return the implicit label scope in which the current node is being
7756 * resolved. 7756 * resolved.
7757 */ 7757 */
7758 ImplicitLabelScope get implicitLabelScope => _implicitLabelScope; 7758 ImplicitLabelScope get implicitLabelScope => _implicitLabelScope;
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after
9331 Scope typeParametersScope = null; 9331 Scope typeParametersScope = null;
9332 for (TypeParameter typeParameter in typeParameters.typeParameters) { 9332 for (TypeParameter typeParameter in typeParameters.typeParameters) {
9333 TypeName bound = typeParameter.bound; 9333 TypeName bound = typeParameter.bound;
9334 if (bound != null) { 9334 if (bound != null) {
9335 Element typeParameterElement = typeParameter.name.staticElement; 9335 Element typeParameterElement = typeParameter.name.staticElement;
9336 if (typeParameterElement is TypeParameterElementImpl) { 9336 if (typeParameterElement is TypeParameterElementImpl) {
9337 if (LibraryElementImpl.hasResolutionCapability( 9337 if (LibraryElementImpl.hasResolutionCapability(
9338 library, LibraryResolutionCapability.resolvedTypeNames)) { 9338 library, LibraryResolutionCapability.resolvedTypeNames)) {
9339 bound.type = typeParameterElement.bound; 9339 bound.type = typeParameterElement.bound;
9340 } else { 9340 } else {
9341 libraryScope ??= new LibraryScope(library, errorListener); 9341 libraryScope ??= new LibraryScope(library);
9342 typeParametersScope ??= createTypeParametersScope(); 9342 typeParametersScope ??= createTypeParametersScope();
9343 typeNameResolver ??= new TypeNameResolver(new TypeSystemImpl(), 9343 typeNameResolver ??= new TypeNameResolver(new TypeSystemImpl(),
9344 typeProvider, library, source, errorListener); 9344 typeProvider, library, source, errorListener);
9345 typeNameResolver.nameScope = typeParametersScope; 9345 typeNameResolver.nameScope = typeParametersScope;
9346 _resolveTypeName(bound); 9346 _resolveTypeName(bound);
9347 typeParameterElement.bound = bound.type; 9347 typeParameterElement.bound = bound.type;
9348 } 9348 }
9349 } 9349 }
9350 } 9350 }
9351 } 9351 }
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after
11136 return null; 11136 return null;
11137 } 11137 }
11138 if (identical(node.staticElement, variable)) { 11138 if (identical(node.staticElement, variable)) {
11139 if (node.inSetterContext()) { 11139 if (node.inSetterContext()) {
11140 result = true; 11140 result = true;
11141 } 11141 }
11142 } 11142 }
11143 return null; 11143 return null;
11144 } 11144 }
11145 } 11145 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/incremental_resolver.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698