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

Unified Diff: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart

Issue 2959823002: Add type inference for super property gets. (Closed)
Patch Set: Created 3 years, 6 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/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
index ffc750075edb4b27cc5d63473ff001cf303a2aef..7192b59a5737674e7621eebb7d0c0f4928b6b3cd 100644
--- a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
+++ b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
@@ -507,6 +507,19 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> {
_recordTypeArguments(node.methodName.offset, inferredTypeArguments);
}
}
+ var methodElement = node.methodName.staticElement;
+ if (node.target is SuperExpression &&
+ methodElement is PropertyAccessorElement) {
+ // This is a hack since analyzer doesn't record .call targets
+ var getterClass = methodElement.returnType.element;
+ if (getterClass is ClassElement) {
+ var target = getterClass.lookUpMethod('call', null) ??
+ getterClass.lookUpGetter('call', null);
+ if (target != null) {
+ _recordTarget(node.argumentList.offset, target);
+ }
+ }
+ }
}
visitPrefixExpression(PrefixExpression node) {
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698