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

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

Issue 1555213002: fix #25305, DeclarationResolver.visitTypeParameter now handles generic methods (Closed) Base URL: git@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/declaration_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 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2370 for (Label label in node.labels) { 2370 for (Label label in node.labels) {
2371 SimpleIdentifier labelName = label.label; 2371 SimpleIdentifier labelName = label.label;
2372 _findIdentifier(_enclosingExecutable.labels, labelName); 2372 _findIdentifier(_enclosingExecutable.labels, labelName);
2373 } 2373 }
2374 return super.visitSwitchDefault(node); 2374 return super.visitSwitchDefault(node);
2375 } 2375 }
2376 2376
2377 @override 2377 @override
2378 Object visitTypeParameter(TypeParameter node) { 2378 Object visitTypeParameter(TypeParameter node) {
2379 SimpleIdentifier parameterName = node.name; 2379 SimpleIdentifier parameterName = node.name;
2380 if (_enclosingClass != null) { 2380
2381 _findIdentifier(_enclosingClass.typeParameters, parameterName); 2381 Element element;
2382 } else if (_enclosingAlias != null) { 2382 if (_enclosingExecutable != null) {
2383 _findIdentifier(_enclosingAlias.typeParameters, parameterName); 2383 element =
2384 _findIdentifier(_enclosingExecutable.typeParameters, parameterName);
2385 }
2386 if (element == null) {
2387 if (_enclosingClass != null) {
2388 _findIdentifier(_enclosingClass.typeParameters, parameterName);
2389 } else if (_enclosingAlias != null) {
2390 _findIdentifier(_enclosingAlias.typeParameters, parameterName);
2391 }
2384 } 2392 }
2385 return super.visitTypeParameter(node); 2393 return super.visitTypeParameter(node);
2386 } 2394 }
2387 2395
2388 @override 2396 @override
2389 Object visitVariableDeclaration(VariableDeclaration node) { 2397 Object visitVariableDeclaration(VariableDeclaration node) {
2390 VariableElement element = null; 2398 VariableElement element = null;
2391 SimpleIdentifier variableName = node.name; 2399 SimpleIdentifier variableName = node.name;
2392 if (_enclosingExecutable != null) { 2400 if (_enclosingExecutable != null) {
2393 element = 2401 element =
(...skipping 10953 matching lines...) Expand 10 before | Expand all | Expand 10 after
13347 nonFields.add(node); 13355 nonFields.add(node);
13348 return null; 13356 return null;
13349 } 13357 }
13350 13358
13351 @override 13359 @override
13352 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); 13360 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
13353 13361
13354 @override 13362 @override
13355 Object visitWithClause(WithClause node) => null; 13363 Object visitWithClause(WithClause node) => null;
13356 } 13364 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/declaration_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698