Skip to content

Commit

Permalink
[VM][kernel] Don't mix in noSuchMethod forwarders
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Stefantsov authored and commit-bot@chromium.org committed Jun 20, 2018
1 parent 6612278 commit a3a8d8b
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ abstract class _C&A&B extends self::A implements self::B {
;
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ abstract class _C&A&B extends self::A implements self::B {
;
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ abstract class _B&Object&A extends core::Object implements self::A {
;
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ abstract class _B&Object&A extends core::Object implements self::A {
;
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
Expand Down
3 changes: 3 additions & 0 deletions pkg/kernel/lib/transformations/mixin_full_resolution.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ class MixinFullResolution {
// 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) {
Expand Down
1 change: 1 addition & 0 deletions tests/language_2/language_2_kernel.status
Original file line number Diff line number Diff line change
Expand Up @@ -2243,6 +2243,7 @@ unresolved_top_level_var_test: MissingCompileTimeError
*: 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
Expand Down

0 comments on commit a3a8d8b

Please sign in to comment.