Skip to content

DDC missing error on forEach invocation #29705

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

Closed
vsmenon opened this issue May 24, 2017 · 2 comments
Closed

DDC missing error on forEach invocation #29705

vsmenon opened this issue May 24, 2017 · 2 comments
Labels
soundness type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dev-compiler

Comments

@vsmenon
Copy link
Member

vsmenon commented May 24, 2017

The following results in a runtime error in checked mode (bar is invoked with no args). In DDC, there is no runtime error. bar is incorrectly called with one arg.

void foo() {
  print('foo');
}

void bar(int x) {
  print('bar $x');
}

List list = <dynamic>[ foo, bar ];

void main() {
  list.forEach((void init()) => init());
}
@vsmenon vsmenon added web-dev-compiler soundness type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels May 24, 2017
@vsmenon
Copy link
Member Author

vsmenon commented May 24, 2017

@leafpetersen I think this is ultimately a fuzzy arrow problem.

List<dynamic>.forEach takes a bottom->void. The forEach implementation would have to use a dcall in this case, but it's not.

If we eliminate fuzzy, the above is a static error, right?

@leafpetersen
Copy link
Member

Yes, this is the fuzzy arrow issue. Duplicate of #29295 .

#29630 is the issue for eliminating fuzzy arrows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
soundness type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dev-compiler
Projects
None yet
Development

No branches or pull requests

2 participants