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

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

Issue 1665353002: Use ElementAnnotation as the ConstantEvaluationTarget for annotations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/lib/src/task/dart.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/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 7344 matching lines...) Expand 10 before | Expand all | Expand 10 after
7355 } 7355 }
7356 safelyVisit(node.name); 7356 safelyVisit(node.name);
7357 safelyVisit(node.constructorName); 7357 safelyVisit(node.constructorName);
7358 Element element = node.element; 7358 Element element = node.element;
7359 if (element is ExecutableElement) { 7359 if (element is ExecutableElement) {
7360 InferenceContext.setType(node.arguments, element.type); 7360 InferenceContext.setType(node.arguments, element.type);
7361 } 7361 }
7362 safelyVisit(node.arguments); 7362 safelyVisit(node.arguments);
7363 node.accept(elementResolver); 7363 node.accept(elementResolver);
7364 node.accept(typeAnalyzer); 7364 node.accept(typeAnalyzer);
7365 ElementAnnotationImpl elementAnnotationImpl = node.elementAnnotation;
7366 if (elementAnnotationImpl == null) {
7367 // Analyzer ignores annotations on "part of" directives.
7368 assert(parent is PartOfDirective);
7369 } else {
7370 elementAnnotationImpl.annotationAst =
7371 new ConstantAstCloner().cloneNode(node);
7372 }
7365 return null; 7373 return null;
7366 } 7374 }
7367 7375
7368 @override 7376 @override
7369 Object visitArgumentList(ArgumentList node) { 7377 Object visitArgumentList(ArgumentList node) {
7370 DartType callerType = InferenceContext.getType(node); 7378 DartType callerType = InferenceContext.getType(node);
7371 if (callerType is FunctionType) { 7379 if (callerType is FunctionType) {
7372 Map<String, DartType> namedParameterTypes = 7380 Map<String, DartType> namedParameterTypes =
7373 callerType.namedParameterTypes; 7381 callerType.namedParameterTypes;
7374 List<DartType> normalParameterTypes = callerType.normalParameterTypes; 7382 List<DartType> normalParameterTypes = callerType.normalParameterTypes;
(...skipping 5212 matching lines...) Expand 10 before | Expand all | Expand 10 after
12587 nonFields.add(node); 12595 nonFields.add(node);
12588 return null; 12596 return null;
12589 } 12597 }
12590 12598
12591 @override 12599 @override
12592 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); 12600 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
12593 12601
12594 @override 12602 @override
12595 Object visitWithClause(WithClause node) => null; 12603 Object visitWithClause(WithClause node) => null;
12596 } 12604 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698