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

Report better error message when calling a closure with wrong (number of) arguments. #17280

Closed
karlklose opened this issue Mar 5, 2014 · 3 comments
Labels
P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug web-dart2js

Comments

@karlklose
Copy link
Contributor

We should tell the user that this is about a closure call and that the argument number/names may be the source of the problem.
Currently we only say that 'call$n' cannot be found.

@floitschG
Copy link
Contributor

Set owner to @floitschG.
Added Started label.

@floitschG
Copy link
Contributor

Unassigning. My first attempts didn't work out, so if anyone wants to take this on, please go ahead.


Removed the owner.
Added Triaged label.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Mar 1, 2016
@srawlins
Copy link
Member

srawlins commented Jul 1, 2018

Given this code:

void main() {
  var c1 = (a, b) => print('$a$b');

  c1(2);
}

dart2js shows the following error at runtime:

Error compiling to JavaScript:
main.dart:4:5:
Error: Too few positional arguments: 2 required, 1 given.

Error: Compilation failed.

Looks pretty good!

@srawlins srawlins closed this as completed Jul 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants