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

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

Issue 2336503003: fix #25578, implement @covariant parameter overrides (Closed)
Patch Set: fix for summaries, thanks Paul! 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.element_resolver; 5 library analyzer.src.generated.element_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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 // TODO(brianwilkerson) Figure out whether the element can ever be 412 // TODO(brianwilkerson) Figure out whether the element can ever be
413 // something other than an ExportElement 413 // something other than an ExportElement
414 _resolveCombinators(exportElement.exportedLibrary, node.combinators); 414 _resolveCombinators(exportElement.exportedLibrary, node.combinators);
415 resolveMetadata(node); 415 resolveMetadata(node);
416 } 416 }
417 return null; 417 return null;
418 } 418 }
419 419
420 @override 420 @override
421 Object visitFieldFormalParameter(FieldFormalParameter node) { 421 Object visitFieldFormalParameter(FieldFormalParameter node) {
422 _resolveMetadataForParameter(node.element, node); 422 _resolveMetadataForParameter(node);
423 return super.visitFieldFormalParameter(node); 423 return super.visitFieldFormalParameter(node);
424 } 424 }
425 425
426 @override 426 @override
427 Object visitFunctionDeclaration(FunctionDeclaration node) { 427 Object visitFunctionDeclaration(FunctionDeclaration node) {
428 resolveMetadata(node); 428 resolveMetadata(node);
429 return null; 429 return null;
430 } 430 }
431 431
432 @override 432 @override
(...skipping 23 matching lines...) Expand all
456 } 456 }
457 457
458 @override 458 @override
459 Object visitFunctionTypeAlias(FunctionTypeAlias node) { 459 Object visitFunctionTypeAlias(FunctionTypeAlias node) {
460 resolveMetadata(node); 460 resolveMetadata(node);
461 return null; 461 return null;
462 } 462 }
463 463
464 @override 464 @override
465 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 465 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
466 _resolveMetadataForParameter(node.element, node); 466 _resolveMetadataForParameter(node);
467 return null; 467 return null;
468 } 468 }
469 469
470 @override 470 @override
471 Object visitImportDirective(ImportDirective node) { 471 Object visitImportDirective(ImportDirective node) {
472 SimpleIdentifier prefixNode = node.prefix; 472 SimpleIdentifier prefixNode = node.prefix;
473 if (prefixNode != null) { 473 if (prefixNode != null) {
474 String prefixName = prefixNode.name; 474 String prefixName = prefixNode.name;
475 List<PrefixElement> prefixes = _definingLibrary.prefixes; 475 List<PrefixElement> prefixes = _definingLibrary.prefixes;
476 int count = prefixes.length; 476 int count = prefixes.length;
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 List<ParameterElement> parameters = 1048 List<ParameterElement> parameters =
1049 _resolveArgumentsToFunction(false, argumentList, element); 1049 _resolveArgumentsToFunction(false, argumentList, element);
1050 if (parameters != null) { 1050 if (parameters != null) {
1051 argumentList.correspondingStaticParameters = parameters; 1051 argumentList.correspondingStaticParameters = parameters;
1052 } 1052 }
1053 return null; 1053 return null;
1054 } 1054 }
1055 1055
1056 @override 1056 @override
1057 Object visitSimpleFormalParameter(SimpleFormalParameter node) { 1057 Object visitSimpleFormalParameter(SimpleFormalParameter node) {
1058 _resolveMetadataForParameter(node.element, node); 1058 _resolveMetadataForParameter(node);
1059 return null; 1059 return null;
1060 } 1060 }
1061 1061
1062 @override 1062 @override
1063 Object visitSimpleIdentifier(SimpleIdentifier node) { 1063 Object visitSimpleIdentifier(SimpleIdentifier node) {
1064 // 1064 //
1065 // Synthetic identifiers have been already reported during parsing. 1065 // Synthetic identifiers have been already reported during parsing.
1066 // 1066 //
1067 if (node.isSynthetic) { 1067 if (node.isSynthetic) {
1068 return null; 1068 return null;
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2263 } 2263 }
2264 } 2264 }
2265 // TODO(brianwilkerson) Report this error. 2265 // TODO(brianwilkerson) Report this error.
2266 return null; 2266 return null;
2267 } 2267 }
2268 2268
2269 /** 2269 /**
2270 * Given a [node] that can have annotations associated with it, resolve the 2270 * Given a [node] that can have annotations associated with it, resolve the
2271 * annotations in the element model representing annotations to the node. 2271 * annotations in the element model representing annotations to the node.
2272 */ 2272 */
2273 void _resolveMetadataForParameter( 2273 void _resolveMetadataForParameter(NormalFormalParameter node) {
2274 Element element, NormalFormalParameter node) {
2275 _resolveAnnotations(node.metadata); 2274 _resolveAnnotations(node.metadata);
2276 } 2275 }
2277 2276
2278 /** 2277 /**
2279 * Given that we are accessing a property of the given [targetType] with the 2278 * Given that we are accessing a property of the given [targetType] with the
2280 * given [propertyName], return the element that represents the property. The 2279 * given [propertyName], return the element that represents the property. The
2281 * [target] is the target of the invocation ('e'). 2280 * [target] is the target of the invocation ('e').
2282 */ 2281 */
2283 ExecutableElement _resolveProperty( 2282 ExecutableElement _resolveProperty(
2284 Expression target, DartType targetType, SimpleIdentifier propertyName) { 2283 Expression target, DartType targetType, SimpleIdentifier propertyName) {
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
2636 2635
2637 @override 2636 @override
2638 Element get staticElement => null; 2637 Element get staticElement => null;
2639 2638
2640 @override 2639 @override
2641 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null; 2640 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null;
2642 2641
2643 @override 2642 @override
2644 void visitChildren(AstVisitor visitor) {} 2643 void visitChildren(AstVisitor visitor) {}
2645 } 2644 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698