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

Unified Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 1754873002: fix ResolutionCopier to copy staticInvokeType/propagatedInvokeType (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 710be9b836ef5c5038ab7409b5f95b6b923ec6ed..78a1f38c5063f986557b7d0799846b09b5080aae 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -4429,20 +4429,16 @@ class ResolutionCopierTest extends EngineTestCase {
MethodElement propagatedElement = ElementFactory.methodElement(
"m", ElementFactory.classElement2("C").type);
fromNode.propagatedElement = propagatedElement;
- DartType propagatedType = ElementFactory.classElement2("C").type;
- fromNode.propagatedType = propagatedType;
MethodElement staticElement = ElementFactory.methodElement(
"m", ElementFactory.classElement2("C").type);
fromNode.staticElement = staticElement;
- DartType staticType = ElementFactory.classElement2("C").type;
- fromNode.staticType = staticType;
FunctionExpressionInvocation toNode =
AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"));
- ResolutionCopier.copyResolutionData(fromNode, toNode);
+
+ _copyAndVerifyInvocation(fromNode, toNode);
+
expect(toNode.propagatedElement, same(propagatedElement));
- expect(toNode.propagatedType, same(propagatedType));
expect(toNode.staticElement, same(staticElement));
- expect(toNode.staticType, same(staticType));
}
void test_visitImportDirective() {
@@ -4564,14 +4560,8 @@ class ResolutionCopierTest extends EngineTestCase {
void test_visitMethodInvocation() {
MethodInvocation fromNode = AstFactory.methodInvocation2("m");
- DartType propagatedType = ElementFactory.classElement2("C").type;
- fromNode.propagatedType = propagatedType;
- DartType staticType = ElementFactory.classElement2("C").type;
- fromNode.staticType = staticType;
MethodInvocation toNode = AstFactory.methodInvocation2("m");
- ResolutionCopier.copyResolutionData(fromNode, toNode);
- expect(toNode.propagatedType, same(propagatedType));
- expect(toNode.staticType, same(staticType));
+ _copyAndVerifyInvocation(fromNode, toNode);
}
void test_visitNamedExpression() {
@@ -4848,6 +4838,25 @@ class ResolutionCopierTest extends EngineTestCase {
ResolutionCopier.copyResolutionData(fromNode, toNode);
expect(toNode.type, same(type));
}
+
+ void _copyAndVerifyInvocation(
+ InvocationExpression fromNode, InvocationExpression toNode) {
+ DartType propagatedType = ElementFactory.classElement2("C").type;
+ fromNode.propagatedType = propagatedType;
+ DartType staticType = ElementFactory.classElement2("C").type;
+ fromNode.staticType = staticType;
+
+ DartType propagatedInvokeType = ElementFactory.classElement2("C").type;
+ fromNode.propagatedInvokeType = propagatedInvokeType;
+ DartType staticInvokeType = ElementFactory.classElement2("C").type;
+ fromNode.staticInvokeType = staticInvokeType;
+
+ ResolutionCopier.copyResolutionData(fromNode, toNode);
+ expect(toNode.propagatedType, same(propagatedType));
+ expect(toNode.staticType, same(staticType));
+ expect(toNode.propagatedInvokeType, same(propagatedInvokeType));
+ expect(toNode.staticInvokeType, same(staticInvokeType));
+ }
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698