interactions between type annotations and language model APIs.
Alex Buckley
alex.buckley at oracle.com
Fri May 9 21:36:16 UTC 2014
Joe,
On 5/9/2014 8:24 AM, Joe Darcy wrote:
> My first reaction here is that these methods should by default ignore
> annotations and we should add another utility method or two like:
>
> <T extends TypeMirror> T withAnnotations(T typeMirror, List<? extends
> AnnotationMirror> annotations)
>
> <T extends TypeMirror> T withAnnotations(T typeMirror,
> AnnotatedConstruct annotationHost)
>
> to allow the annotations savvy user to perform whatever annotation
> passing along or computation is appropriate for the problem domain.
In other words, specify in javax.lang.model.util.Types that it is
unspecified as to the presence of type annotations in a TypeMirror
object returned by a Types' method ? And also, specify builder methods
that decorate an existing TypeMirror object with type annotations ?
This approach sidesteps the complexities (alluded to in my prior mail)
of trying to enrich certain methods' results with type annotations.
This approach also exposes that "there's more than one way to do it", so
we should not rush into decisions that ultimately will be part of JSR
269's next Maintenance Review. Do you keep a to-do list for 269 somewhere?
Alex
More information about the compiler-dev
mailing list