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

Unified Diff: pkg/analyzer/lib/src/fasta/resolution_applier.dart

Issue 2982323002: Implement AstBuilder integration for instance creation expressions. (Closed)
Patch Set: Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/testcases/ast_builder.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/fasta/resolution_applier.dart
diff --git a/pkg/analyzer/lib/src/fasta/resolution_applier.dart b/pkg/analyzer/lib/src/fasta/resolution_applier.dart
index 1f273c11c37fe637485b22a9e4efae748d8b50d9..f6b09e8fcabf4c2da380b8567472d0826da60dc4 100644
--- a/pkg/analyzer/lib/src/fasta/resolution_applier.dart
+++ b/pkg/analyzer/lib/src/fasta/resolution_applier.dart
@@ -28,13 +28,31 @@ class ResolutionApplier extends GeneralizingAstVisitor {
node.staticType = _getTypeFor(node);
}
+ @override
+ void visitInstanceCreationExpression(InstanceCreationExpression node) {
+ node.argumentList?.accept(this);
+ // TODO(paulberry): store resolution of node.constructorName.
+ node.staticType = _getTypeFor(node.constructorName);
+ }
+
@override
void visitMethodInvocation(MethodInvocation node) {
node.target?.accept(this);
// TODO(paulberry): store resolution of node.methodName.
// TODO(paulberry): store resolution of node.typeArguments.
node.argumentList.accept(this);
- node.staticType = _getTypeFor(node);
+ node.staticType = _getTypeFor(node.methodName);
+ }
+
+ @override
+ void visitVariableDeclaration(VariableDeclaration node) {
+ if (node.parent is VariableDeclarationList &&
+ node.parent.parent is TopLevelVariableDeclaration) {
+ // Don't visit the name; resolution for it will come from the outline.
+ } else {
+ node.name.accept(this);
+ }
+ node.initializer?.accept(this);
}
@override
@@ -57,17 +75,6 @@ class ResolutionApplier extends GeneralizingAstVisitor {
}
}
- @override
- void visitVariableDeclaration(VariableDeclaration node) {
- if (node.parent is VariableDeclarationList &&
- node.parent.parent is TopLevelVariableDeclaration) {
- // Don't visit the name; resolution for it will come from the outline.
- } else {
- node.name.accept(this);
- }
- node.initializer?.accept(this);
- }
-
void _applyToTypeAnnotation(DartType type, TypeAnnotation typeAnnotation) {
// TODO(paulberry): implement this.
}
« no previous file with comments | « no previous file | pkg/front_end/testcases/ast_builder.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698