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

[Question] support annotated types in records #55604

Open
d-markey opened this issue Apr 20, 2024 · 1 comment
Open

[Question] support annotated types in records #55604

d-markey opened this issue Apr 20, 2024 · 1 comment
Labels
analyzer-api Issues that impact the public API of the analyzer package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@d-markey
Copy link
Contributor

d-markey commented Apr 20, 2024

Hello,

I'm using build_runner: ^2.4.8 on Dart 3.3.4 (stable) from Flutter 3.19.6.

I've developed a builder and would like to use annotations on types in records, eg:

(int, @CustomSerializer() CustomType) myMethod(...) { ... }

The syntax is accepted by Dart and the program compiles, however I found no way to access the @CustomSerializer() annotation for CustomType in my builder, presumably because the method element carries a resolved DartType in returnType. I can inspect the types that are part of the record, but can't navigate to the location in the AST that defined that record type.

Is there a way to achieve this, or is it considered at all?

@jakemac53 jakemac53 transferred this issue from dart-lang/build Apr 30, 2024
@jakemac53 jakemac53 added analyzer-api Issues that impact the public API of the analyzer package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Apr 30, 2024
@jakemac53
Copy link
Contributor

This sounds to me like an analyzer question - transferred the issue to the SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-api Issues that impact the public API of the analyzer package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

2 participants