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

What should OmittedTypeAnnotation.code produce? #55677

Open
jakemac53 opened this issue May 9, 2024 · 2 comments
Open

What should OmittedTypeAnnotation.code produce? #55677

jakemac53 opened this issue May 9, 2024 · 2 comments
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. feature-macros Implementation of the macros feature library-macros The experimental dart:_macros library

Comments

@jakemac53
Copy link
Contributor

Today, it ends up putting the OmittedTypeAnnotation directly into the code.

We could keep that, and possibly just change the toString() of OmittedTypeAnnotation, but that seems a bit weird.

In https://dart-review.googlesource.com/c/sdk/+/365960/1 I tried to change the code object to just the string <omitted>, but that broke various tests - it looks like we are actually putting in the inferred type eventually through some magic smarts, at least in some scenarios. But, I don't really understand the mechanisms at play here.

cc @johnniwinther

@jakemac53 jakemac53 added feature-macros Implementation of the macros feature library-macros The experimental dart:_macros library labels May 9, 2024
@mraleph mraleph added the area-front-end Use area-front-end for front end / CFE / kernel format related issues. label May 11, 2024
@johnniwinther
Copy link
Member

In phase 1+2 augmentation libraries the omitted types are generated as OmittedType1, OmittedType2, etc and replaced with the inferred type in phase 3 and merged augmentation libraries. I think we assert or throw if the type isn't inferred.

@jakemac53
Copy link
Contributor Author

jakemac53 commented May 13, 2024

Ok, so you do expect to get the actual OmittedTypeAnnotation back? I could just update the Code API docs to say that these are also valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. feature-macros Implementation of the macros feature library-macros The experimental dart:_macros library
Projects
None yet
Development

No branches or pull requests

3 participants