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

Macros: Expose to FormalParameter whether a field is final or not. #55764

Open
rrousselGit opened this issue May 17, 2024 · 3 comments
Open

Macros: Expose to FormalParameter whether a field is final or not. #55764

rrousselGit opened this issue May 17, 2024 · 3 comments
Labels
area-fe-analyzer-shared Assigned by engineers; when triaging, prefer either area-front-end or area-analyzer. cfe-feature-macros Implement macros features in the CFE feature-macros Implementation of the macros feature pkg-macros The experimental package:_macros library

Comments

@rrousselGit
Copy link

Hello!

Function parameters can be optionally declared as final. This is useful information for macros. For example, Freezed relies on it to know if the associated generated field needs to be final or var.

Would it be possible to list it?

I'm aware about FormalParameter.code.keywords, but this only lists required

@rrousselGit rrousselGit changed the title Macros: Expose to FormatParameter whether a field is final or not. Macros: Expose to FormalParameter whether a field is final or not. May 17, 2024
@rrousselGit
Copy link
Author

It would also be cool to know if a field is using super. or this.

@rrousselGit
Copy link
Author

More possibly missing values:
An isConst for `ConstructorDeclaration.

@rrousselGit
Copy link
Author

Some more information that I'd need to port a code-generator:
The list of initializers of a constructor, and the Code of their asserts ; if any.

@lrhn lrhn added pkg-macros The experimental package:_macros library area-fe-analyzer-shared Assigned by engineers; when triaging, prefer either area-front-end or area-analyzer. feature-macros Implementation of the macros feature labels May 19, 2024
@johnniwinther johnniwinther added the cfe-feature-macros Implement macros features in the CFE label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-fe-analyzer-shared Assigned by engineers; when triaging, prefer either area-front-end or area-analyzer. cfe-feature-macros Implement macros features in the CFE feature-macros Implementation of the macros feature pkg-macros The experimental package:_macros library
Projects
None yet
Development

No branches or pull requests

3 participants