-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[DDC] JS staticInterop works poorly with variadic arguments, runtime failures #49785
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
Comments
@matanlurey - what version of the tools are you using to run these examples? We currently implement the extensions as a lowering in the compilers, so both compilers behave the same, but the error you see seems like an error I'd expect when the lowering was not enabled (which could be the case in an older version of the SDK). Unfortunately, I don't believe there is an SDK lower bound on package:js for this. More generally, we have talked about being more flexible with JS functions and being less strict about arity than we are with Dart functions, for example, to support use cases like #48186. |
You mean the SDK?
If you're asking about
I guess I'm confused why
Sounds good. It's not blocking any work, this is a personal project, I was just surprised. Happy to wait for the next stable release.
Nice! I ran into this problem as well with |
Thanks! Technically webdev wouldn't affect things, you are correct, that said, in the past we have seen issues in some modular configurations that don't show up in others (e.g. the incremental front-end server shows issues with a transformer that makes the incremental compiler state invalid for hot restart) - so, as a result, there are issues that sometimes pop up only under certain environments. I can't quite explain why you saw the runtime errors with |
I haven't tried, and probably won't if the DDC bits don't work yet. No worries :) |
Dart SDK version: 2.17.6 (stable) (Tue Jul 12 12:54:37 2022 +0200) on "macos_arm64"
I might have tried to be "too clever" for my own good, but here is what I tried and what happens:
Everything compiles (no errors), but at runtime I get:
The generated DDC JS code looks like this:
I find this pretty bizarre personally. It works fine like this:
... but then I can only provide a single argument. I tried using optional arguments:
... but then I get
null
printed in the console for every unused argument.The text was updated successfully, but these errors were encountered: