Skip to content

[Extension type] DDC implementation #49735

Open
Listed in
Open
@itsjustkevin

Description

@itsjustkevin
No description provided.

Activity

added
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.
on Aug 19, 2022
added
P2A bug or feature request we're likely to work on
on Oct 26, 2022
eernstg

eernstg commented on Mar 6, 2023

@eernstg
Member

Please note that this feature has been renamed: It is now the 'inline class' feature.

changed the title [-][Views] DDC implementation[/-] [+][Inline Class] DDC implementation[/+] on Mar 6, 2023
changed the title [-][Inline Class] DDC implementation[/-] [+][Extension type] DDC implementation[/+] on Jul 25, 2023
nshahan

nshahan commented on Aug 18, 2023

@nshahan
Contributor

Open question: Is it useful for DDC to see ExtensionType nodes in the AST or can they be erased sometime before compilation begins? Are they necessary for the production of JS interop errors?

sigmundch

sigmundch commented on Aug 21, 2023

@sigmundch
Member

I believe it is useful. @srujzs can share more, but I believe the _js_interop_checker and transformation that runs from DDC and dart2js needs to see the extension classes to properly do its work. That said, during code emission performing the erasure should be simple in that the CFE already provides the erasure semantics as properties on the extension type (e.g. DDC can read the internal .erasedType and emit that instead.)

@annagrin - may also have some insights from the debugging perspective. There may be some metadata that we may need to include in the future to integrate with devtools.

srujzs

srujzs commented on Aug 21, 2023

@srujzs
Contributor

Nick and I chatted offline shortly after - we indeed do need to see ExtensionTypes in the AST to make some of our interop checks work. Our takeaway was that there is a small tax, however, from handling these types in every visitor (and not handling it is not necessarily an error). In DDC's case, there are some explicit conditionals checking for types too (and emitting an "invalid" type if not handled), so this lead to some hidden errors. Still, this can be handled by just calling typeErasure and more generally, these issues can be fixed by improving how we visit types as well.

I think the open question then is whether there's a way to have the JS interop checks still see nodes related to extension types, but have DDC use a lowering that removes them from the AST.

added
P1A high priority bug; for example, a single project is unusable or has many test failures
and removed
P2A bug or feature request we're likely to work on
on Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @sigmundch@biggs0125@nshahan@a-siva@eernstg

      Issue actions

        [Extension type] DDC implementation · Issue #49735 · dart-lang/sdk