That actually brings up a pain point for doing this in Guice: adding ElementType.TYPE_USE to the targets for @Named would make Java 8 required to build Guice. Not sure how feasible that is for Google.
JSR 330's @Named doesn't have that problem because it doesn't limit @Named's targets at all. On Tuesday, 8 April 2014 12:18:49 UTC-4, Tim Peierls wrote: > > On Mon, Apr 7, 2014 at 5:47 PM, Sam Berlin <[email protected] <javascript:> > > wrote: > >> I'd be open to any of the following: >> a) Hard-error on a qualifer/bindingannotation on types >> b) Support qualifer/bindingannotation on types, but fail if it also >> exists on the variable >> >> Though, since this'd be a change to the way jsr330 things are >> interpreted, seems like it'd be best to poll the jsr330 folks and make sure >> all various implementations (Dagger, Spring, etc..) are on-board with the >> same solution. >> > > The 330 spec says that "A qualifier annotation > > - may have restricted usage if annotated with @Target. While this > specification covers applying qualifiers to fields and parameters only, > some injector configurations might use qualifier annotations in other > places (on methods or classes for example). > > I was on the 330 EG. My memory is that this wording was chosen > specifically to allow for the future use of type annotations, which were at > that point in an "any day now" state (and had been for quite some time). > > --tim > -- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-guice. For more options, visit https://groups.google.com/d/optout.
