Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VM] Wrong type of noSuchMethod forwarder torn-off in case of mixin application #53676

Closed
sgrekhov opened this issue Oct 3, 2023 · 1 comment
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sgrekhov
Copy link
Contributor

sgrekhov commented Oct 3, 2023

Please see the following code

class C {
  noSuchMethod(Invocation i) => "C";
  String foo();
}

mixin M {
  noSuchMethod(Invocation i) => "M";
  String foo();
}

class MA = Object with M;

void main() {
  C c = C();
  Function f1 = c.foo;
  print(f1()); // prints C

  MA ma = MA();
  Function f2 = ma.foo; 
  print(f2()); // NoSuchMethodError: Class 'String' has no instance method 'call'. Receiver: "M"
}

No this issue on DartPad. So, I believe, it's pure VM issue
Tested on Dart SDK version: 3.2.0-220.0.dev (dev) (Sat Sep 30 13:02:52 2023 -0700) on "windows_x64"

@sgrekhov sgrekhov added the area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. label Oct 3, 2023
@eernstg eernstg added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Oct 3, 2023
@alexmarkov alexmarkov self-assigned this Oct 6, 2023
@alexmarkov
Copy link
Contributor

The incorrect behavior is caused by the missing forwarding stub in the mixin application class. Duplicate to #53677.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants