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

[Wildcard Variables] Dart2JS Implementation #55750

Open
Tracked by #55673
kallentu opened this issue May 16, 2024 · 1 comment
Open
Tracked by #55673

[Wildcard Variables] Dart2JS Implementation #55750

kallentu opened this issue May 16, 2024 · 1 comment
Assignees
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. feature-wildcard-variables Implementation of the wildcard variables feature web-dart2js

Comments

@kallentu
Copy link
Member

This issue tracks the work needed for the wildcard variables feature to be supported in Dart2JS.

We may need to do some additional work to support multiple wildcard parameters in functions.

class A {
  int add(int a, int b) => 3;
}

class C implements A {
  int add(int _, int _) => 3;
}

cc. @sigmundch Feel free to tag or reassign as you see fit.
I'd also appreciate more details so we don't lose that context.

@kallentu kallentu added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label May 16, 2024
@sigmundch
Copy link
Member

Thanks @kallentu, similar comments to what I posted in the DDC issue:

  • the work here depends a lot on what kind of lowering we end up doing in the CFE
  • the lowering will likely convert the wildcard variables into something, potentially a variable declaration that is never read.
  • if the lowering uses the existing representation of variable declarations and guarantees uniqueness of variable names like today parameters have, then the backend may not need to do anything special for it to generate valid JavaScript. However, if the variable is represented by a new kernel node or a node that breaks current invariants, we may need some relatively small amount of work to emit valid JavaScript function declarations. The work could be similar to what DDC already does for temporary variables in Let expressions.

@kallentu kallentu added the feature-wildcard-variables Implementation of the wildcard variables feature label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. feature-wildcard-variables Implementation of the wildcard variables feature web-dart2js
Projects
None yet
Development

No branches or pull requests

2 participants