Skip to content

No error in CFE when call getter of an extension is invoked #59962

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

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

No error in CFE when call getter of an extension is invoked #59962

sgrekhov opened this issue Jan 23, 2025 · 0 comments
Assignees
Labels
cfe-dysfunctionalities Issues for the CFE not behaving as intended legacy-area-front-end Legacy: Use area-dart-model instead. 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 following code produces an error in the analyzer but works in CFE

class BEC {}

extension on BEC {
  int Function(int) get call => (int x) => x;
}

main() {
  BEC()(42); // Analyzer error: The expression doesn't evaluate to a function, so it can't be invoked. invocation_of_non_function_expression
}

According to the #55803 (comment) there should be an error in the CFE as well.

cc @lrhn

Dart SDK version: 3.8.0-12.0.dev (dev) (Sun Jan 19 16:06:48 2025 -0800) on "windows_x64"

@sgrekhov sgrekhov added legacy-area-front-end Legacy: Use area-dart-model instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jan 23, 2025
@johnniwinther johnniwinther added the cfe-dysfunctionalities Issues for the CFE not behaving as intended label Jan 23, 2025
@sgrekhov sgrekhov changed the title No error in CFE when call getter og an extension is invoked No error in CFE when call getter of an extension is invoked Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cfe-dysfunctionalities Issues for the CFE not behaving as intended legacy-area-front-end Legacy: Use area-dart-model instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants