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

No runtime error when call getter is implicitly invoked #59965

Open
sgrekhov opened this issue Jan 23, 2025 · 0 comments
Open

No runtime error when call getter is implicitly invoked #59965

sgrekhov opened this issue Jan 23, 2025 · 0 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sgrekhov
Copy link
Contributor

This issue derieved from the test mentioned in #55803 (comment). The code below should produce a runtime error but it doesn't.

class BC {
  int Function(int) get call => (int x) => x;
}

main() {
  (BC() as dynamic)(42); // No error
}

According to the #55803 (comment) implicitly inserted .call invocations cannot invoke a getter and, therefore, there should be a runtime error.

cc @lrhn

Dart SDK version: 3.8.0-21.0.dev (dev) (Tue Jan 21 20:02:01 2025 -0800) on "windows_x64"

@sgrekhov sgrekhov added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jan 23, 2025
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, 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

1 participant