It's Guice's @Named that's an issue, not javax.inject, which does not
restrict. As sam said in a sister post, we should just un-encumber
@Named with the element type restrictions, and we can provide
alternative means to restrict if we want to clamp down (annotation
processors or error-prone which can be selectively applied).
Dagger will also need to loosen its limitations, but it implements them
with annotation processors, and uses the javax.inject version of @Named,
so I think we can get all of this consistent at least with respect to
Guice-derived injector systems.
c.
On 8 Apr 2014, at 9:50, John Wells wrote:
> Yeah, I would be against anything in JSR-330 (or whatever extension
> thereof) that would force a requirement of Java 8
>
>
> On Tue, Apr 8, 2014 at 12:41 PM, Tavian Barnes <
tavia...@gmail.com>
> wrote:
>
>> 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 <
sbe...@gmail.com> 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