-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unclear error message for function getting wrong arguments #2156
Comments
This comment was originally written by [email protected] Lode, have you tried to run this code in checked mode (http://www.dartlang.org/articles/optional-types/) ? Removed Area-Dartium label. |
This comment was originally written by [email protected] The error is better in checked mode: type '() => Dynamic' is not a subtype of type '(Event) => void' of 'handler'. So I guess we have to learn to recognize different error messages in checked and non checked mode? :) |
Removed Priority-Medium label. |
Removed this from the M5 milestone. |
This comment was originally written by @mhausner I think this is no longer accurate. In a similar situation calling a closure with wrong number of arguments) we now get this info in production mode (i.e. not checked mode): NoSuchMethodError: incorrect number of arguments passed to method named 'main.<anonymous closure>' Added AssumedStale label. |
matcher (https://github.com/dart-lang/matcher/compare/fcbd361..d9cf4f6): d9cf4f6 2024-01-01 dependabot[bot] Bump actions/stale from 8.0.0 to 9.0.0 (#240) 7ea9047 2023-12-13 Kevin Moore Update test_api dependency, bump & fix lints, prepare release (#237) 050fdda 2023-12-13 Kevin Moore blast_repo fixes (#238) mockito (https://github.com/dart-lang/mockito/compare/57a7c82..e15e000): e15e000 2023-12-14 Sam Rawlins Bump mockito to 5.4.4 a2a6566 2023-12-14 Copybara-Service Merge pull request #726 from provokateurin:chore/deps/test_api-0.7 bda332c 2023-12-14 jld3103 chore(deps): Allow test_api 0.7 9bd6fb0 2023-12-12 Paul Berry Remove mockito pre-null-safety tests. test (https://github.com/dart-lang/test/compare/43ff5bf..846d73e): 846d73ee 2024-01-01 dependabot[bot] Bump actions/upload-artifact from 3.1.3 to 4.0.0 (#2165) 0ab56790 2024-01-01 dependabot[bot] Bump actions/stale from 8.0.0 to 9.0.0 (#2167) 3b960c3e 2024-01-01 dependabot[bot] Bump github/codeql-action from 2.22.8 to 3.22.12 (#2166) 30543cae 2023-12-19 Nate Bosch Add more logging around iframe startup (#2160) e56a5e22 2023-12-13 Jacob MacDonald small cleanup in catch (#2159) 15b39372 2023-12-13 Jacob MacDonald handle missing package config files (#2158) 9667cca8 2023-12-13 Jacob MacDonald release test_api 7.0.0, test_core 6.0.0, and test 1.25.0 (#2156) b3fb1486 2023-12-13 Nate Bosch Remove support for Internet Explorer (#2114) 48a2bc3d 2023-12-13 Derek Xu Update the package:vm_service constraint to allow version 14.x (#2157) Change-Id: I386444652c47cd14a61665599d86dc3a7669a2fc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345341 Reviewed-by: Nate Bosch <[email protected]> Commit-Queue: Devon Carew <[email protected]>
This issue was originally filed by [email protected]
Hello,
I tried out code like this, where "view.on.click" takes a function responding to mouse click events:
view.on.click = function() {
print('clicked');
};
The above is wrong, it has to be, for example:
view.on.click = function(var event) {
print('clicked');
};
Dartium gives the following error message:
Exception: Closure argument mismatch
It would be nice if it would say something more helpful, like "Wrong function signature, one argument of type ..... required".
The text was updated successfully, but these errors were encountered: