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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2920223008: Record method invocation targets that are not procedures. (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
Index: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index 0a055426511823f9fd96543379930aa27c85bb59..002ab8ef25c1dc1a510fddd932d88b92849e3ef6 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -1061,15 +1061,22 @@ class KernelMethodInvocation extends MethodInvocation
if (receiverType is InterfaceType) {
interfaceMember = inferrer.classHierarchy
.getInterfaceMember(receiverType.classNode, name);
- if (interfaceMember is Procedure) {
- // Our non-strong golden files currently don't include interface
- // targets, so we can't store the interface target without causing tests
- // to fail. TODO(paulberry): fix this.
- if (inferrer.strongMode) {
+ // Our non-strong golden files currently don't include interface
+ // targets, so we can't store the interface target without causing tests
+ // to fail. TODO(paulberry): fix this.
+ if (inferrer.strongMode) {
+ if (interfaceMember != null) {
inferrer.instrumentation?.record(Uri.parse(inferrer.uri), fileOffset,
'target', new InstrumentationValueForMember(interfaceMember));
+ }
+ // interfaceTarget is currently required to be a procedure, so we skip
+ // if it's anything else. TODO(paulberry): fix this - see
+ // https://codereview.chromium.org/2923653003/.
+ if (interfaceMember is Procedure) {
interfaceTarget = interfaceMember;
}
+ }
+ if (interfaceMember is Procedure) {
isOverloadedArithmeticOperator = inferrer.typeSchemaEnvironment
.isOverloadedArithmeticOperator(interfaceMember);
}

Powered by Google App Engine
This is Rietveld 408576698