-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Analyzer support for type arguments on annotations #44838
Labels
analyzer-spec
Issues with the analyzer's implementation of the language spec
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
implementation
Track the implementation of a specific feature (use on area-meta issue, not issues for each tool)
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
Milestone
Comments
dart-bot
pushed a commit
that referenced
this issue
Feb 4, 2021
Bug: #44838 Change-Id: I55b8dacc571570568c1b3f101a1a4e1f517f7f6f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182581 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
dart-bot
pushed a commit
that referenced
this issue
Feb 5, 2021
Currently we don't support generic metadata, but we'll be adding support soon (dart-lang/language#1297). When we add it, we'll still want to have tests to make sure that it's not allowed in older language versions. The tests we currently have to make sure it's not allowed only test annotations occurring outside of function bodies, however the front end code paths for handling code inside function bodies are sufficiently different that it makes sense to test inside function bodies too. Bug: #44838 Change-Id: I846f2fc2e5ae090f21744ed6407b21a48a6d08ff Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182601 Reviewed-by: Bob Nystrom <rnystrom@google.com>
dart-bot
pushed a commit
that referenced
this issue
Feb 5, 2021
This CL updates the parser so that it allows annotations of the form: `@` <constructorDesignation> <argumentPart> Where <argumentPart> can contain type arguments. Previously this was prohibited at parse time. Generic annotations are still prohibited in the current language version, but the error is now generated by the parser listener (BodyBuilder in the case of CFE, AstBuilder in the case of analyzer); this should open the door for future CLs to add support for generic annotations when the `generic-metadata` experimental flag is supplied. Bug: #44838 Change-Id: I90604f38bcb378fc798c5737e486fb26589d4d1e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182668 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Jens Johansen <jensj@google.com>
dart-bot
pushed a commit
that referenced
this issue
Feb 5, 2021
Bug: #44838 Change-Id: If69cbbc13a087f0f6280da0bc7f9dbca1d3ec0ea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182740 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
dart-bot
pushed a commit
that referenced
this issue
Feb 5, 2021
The update to AstCloner was made as part of ba5064f, but it couldn't be unit tested until now due to the lack of parser support. Bug: #44838 Change-Id: If2fd5ce41a46c3460b5f90ba854f22ae1baef11c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182840 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
3 tasks
@leafpetersen @eernstg Are we allowed to combine generic metadata and generic functions as type arguments? Is this valid code? class A<T> {
const A();
}
@A<U Function<U>()>()
void f() {} Or with inference? class A<T> {
const A(T _);
}
@A(g)
void f() {}
U g<U>() => throw 0; |
I see no reason to make that combination an error, whether inferred or written explicitly. |
dart-bot
pushed a commit
that referenced
this issue
Apr 1, 2021
Change-Id: I6d22e06775d31856fc85a350892efe15208832f5 Bug: #44838 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193743 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
AFAIK this is done. |
#45579 was fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
analyzer-spec
Issues with the analyzer's implementation of the language spec
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
implementation
Track the implementation of a specific feature (use on area-meta issue, not issues for each tool)
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
(Parent issue #44917)
This issue tracks the analyzer work necessary to support type arguments on annotations, for example:
For justification and additional planning details, please see:
The text was updated successfully, but these errors were encountered: