[VM][kernel] Don't mix in noSuchMethod forwarders
Bug: http://dartbug.com/33380
Change-Id: I57f85e1e33105c4ffcb6a9c8a970cfbc42318936
Reviewed-on: https://dart-review.googlesource.com/60924
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/concrete_method_over_forwarder_in_mixin_application.dart.direct.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/concrete_method_over_forwarder_in_mixin_application.dart.direct.transformed.expect
index 95971e6..45424c8 100644
--- a/pkg/front_end/testcases/no_such_method_forwarders/concrete_method_over_forwarder_in_mixin_application.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/no_such_method_forwarders/concrete_method_over_forwarder_in_mixin_application.dart.direct.transformed.expect
@@ -29,8 +29,6 @@
;
method noSuchMethod(dynamic _) → dynamic
return null;
- no-such-method-forwarder method foo() → dynamic
- return this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} dynamic;
}
class C extends self::_C&A&B {
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/concrete_method_over_forwarder_in_mixin_application.dart.strong.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/concrete_method_over_forwarder_in_mixin_application.dart.strong.transformed.expect
index 5fce966..15ead99 100644
--- a/pkg/front_end/testcases/no_such_method_forwarders/concrete_method_over_forwarder_in_mixin_application.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/no_such_method_forwarders/concrete_method_over_forwarder_in_mixin_application.dart.strong.transformed.expect
@@ -29,8 +29,6 @@
;
method noSuchMethod(core::Invocation _) → dynamic
return null;
- no-such-method-forwarder method foo() → dynamic
- return this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} dynamic;
}
class C extends self::_C&A&B {
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/forwarders_not_assumed_from_mixin.dart.direct.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/forwarders_not_assumed_from_mixin.dart.direct.transformed.expect
index d517aeb..4211c4c 100644
--- a/pkg/front_end/testcases/no_such_method_forwarders/forwarders_not_assumed_from_mixin.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/no_such_method_forwarders/forwarders_not_assumed_from_mixin.dart.direct.transformed.expect
@@ -23,8 +23,6 @@
;
method noSuchMethod(core::Invocation i) → dynamic
return null;
- no-such-method-forwarder method foo() → void
- return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
}
class B extends self::_B&Object&A {
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/forwarders_not_assumed_from_mixin.dart.strong.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/forwarders_not_assumed_from_mixin.dart.strong.transformed.expect
index d517aeb..4211c4c 100644
--- a/pkg/front_end/testcases/no_such_method_forwarders/forwarders_not_assumed_from_mixin.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/no_such_method_forwarders/forwarders_not_assumed_from_mixin.dart.strong.transformed.expect
@@ -23,8 +23,6 @@
;
method noSuchMethod(core::Invocation i) → dynamic
return null;
- no-such-method-forwarder method foo() → void
- return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
}
class B extends self::_B&Object&A {
synthetic constructor •() → void
diff --git a/pkg/kernel/lib/transformations/mixin_full_resolution.dart b/pkg/kernel/lib/transformations/mixin_full_resolution.dart
index d546fe4..d132d11 100644
--- a/pkg/kernel/lib/transformations/mixin_full_resolution.dart
+++ b/pkg/kernel/lib/transformations/mixin_full_resolution.dart
@@ -180,6 +180,9 @@
// Factory constructors are not cloned.
if (procedure.isFactory) continue;
+ // NoSuchMethod forwarders aren't cloned.
+ if (procedure.isNoSuchMethodForwarder) continue;
+
Procedure clone = cloner.clone(procedure);
// Linear search for a forwarding stub with the same name.
for (int i = 0; i < originalLength; ++i) {
diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status
index 23af310..2683fea 100644
--- a/tests/language_2/language_2_kernel.status
+++ b/tests/language_2/language_2_kernel.status
@@ -2243,6 +2243,7 @@
*: SkipByDesign # language_2 is only supported in strong mode.
[ ($compiler == app_jitk || $compiler == dartk || $compiler == dartkp) && ($runtime == dart_precompiled || $runtime == vm) ]
+super_no_such_method4_test: RuntimeError # Issue 33517
super_operator_index6_test: CompileTimeError # Issue 33498
super_operator_index7_test: CompileTimeError # Issue 33498
super_operator_index8_test: CompileTimeError # Issue 33498