Index: lib/compiler/implementation/ssa/codegen.dart |
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart |
index d8cda34819f032deac654b695f644fdd9f52c831..3e74229b68d0037809892794f9136ad01e8917be 100644 |
--- a/lib/compiler/implementation/ssa/codegen.dart |
+++ b/lib/compiler/implementation/ssa/codegen.dart |
@@ -1513,6 +1513,12 @@ abstract class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
Selector defaultSelector) { |
// TODO(4434): For private members we need to use the untyped selector. |
if (defaultSelector.name.isPrivate()) return defaultSelector; |
+ // If [InvocationMirror.invokeOn] is called we must not create a typed |
+ // selector based on the receiver type. |
+ if (backend.compiler.enabledNoSuchMethod && |
+ backend.compiler.enabledInvokeOn) { |
+ return defaultSelector; |
+ } |
HType receiverHType = types[node.inputs[0]]; |
DartType receiverType = receiverHType.computeType(compiler); |
if (receiverType != null) { |