You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We already allow this for type declarations (in phase 2 & 3), but don't have an API for other declarations. We will likely want to either change the return type of the existing declarationOf API in phase 3 to be just Declaration, or we will want to rename it to typeDeclarationOf and then add a new declarationOf API for phase 3.
See #1930 (comment), previously this wasn't really necessary for anything because there was not really any way to get an identifier for anything other than a type except for from the declaration itself (so you already had access to it). But with metadata annotations, you will want to be able to go look at the identifiers.
Another possible approach could be to just force you to evaluate the identifier, and then expose the type of it through the returned object.
The text was updated successfully, but these errors were encountered:
- Rename declarationOf to typeDeclarationOf.
- Add declarationOf api for general declarations.
- Tighten the type of typeDeclarationOf in the final phase to avoid unnecessary
casts in user code.
- Refactor message handling a bit to unify the error handling.
Bug: dart-lang/language#3216
Change-Id: Ia61da19374abec77853d37e110a08f7dfe0d3b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314280
Commit-Queue: Jake Macdonald <[email protected]>
Auto-Submit: Jake Macdonald <[email protected]>
Reviewed-by: Bob Nystrom <[email protected]>
We already allow this for type declarations (in phase 2 & 3), but don't have an API for other declarations. We will likely want to either change the return type of the existing
declarationOf
API in phase 3 to be justDeclaration
, or we will want to rename it totypeDeclarationOf
and then add a newdeclarationOf
API for phase 3.See #1930 (comment), previously this wasn't really necessary for anything because there was not really any way to get an identifier for anything other than a type except for from the declaration itself (so you already had access to it). But with metadata annotations, you will want to be able to go look at the identifiers.
Another possible approach could be to just force you to evaluate the identifier, and then expose the type of it through the returned object.
The text was updated successfully, but these errors were encountered: