[External] : Re: RFR: 8231436: Fix the applicability of a no- at Target annotation type
Alex Buckley
alex.buckley at oracle.com
Thu Feb 11 20:29:00 UTC 2021
On 2/11/2021 11:28 AM, Liam Miller-Cushon wrote:
> On Thu, Feb 11, 2021 at 9:52 AM Alex Buckley <alex.buckley at oracle.com
> <mailto:alex.buckley at oracle.com>> wrote:
>
> On 2/9/2021 6:34 AM, Brian Goetz wrote:
> > So I agree with Joe that:
> >
> >> I think it can be reasonable to interpret lack of @Target to mean
> >> "usable in any declaration context," but ill-advised to silently
> >> reinterpret absence of a @Target to indicate types and
> declarations.
> >
> > and prefer that we leave the existing interpretation of "all
> declaration
> > contexts" for NTAs.
>
> Thanks Brian. I will proceed with that policy by filing a new spec bug
> to overrule JDK-8231435.
>
>
> Thanks all. I will close this review.
I have filed spec bug https://bugs.openjdk.java.net/browse/JDK-8261610
Since the javac bug JDK-8231436 never got beyond New status, I think it
would be reasonable to use it as the carrier for javac changes connected
with the new spec bug.
> To confirm, is there still consensus that "all declaration contexts" for
> NTAs includes declaration contexts introduced in later language levels,
> i.e. NTAs should be applicable to module declarations in Java >= 9, and
> that it's OK to proceed with JDK-8261088?
Yes. The spec bug discusses the open-ended nature of "all declaration
contexts", including that it captures module declarations added in 9.
For JDK-8261088, the anno.interface T (applicable in all declaration
contexts, including modules) should be able to nominate a containing
anno.interface that's applicable in only the module declaration context.
Alex
More information about the compiler-dev
mailing list