[jdk16] RFR: 8258515: javac should issue an error if an annotation is nested in a local class or interface

Jonathan Gibbons jjg at openjdk.java.net
Thu Dec 17 18:08:57 UTC 2020


On Thu, 17 Dec 2020 15:27:48 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> Spec [1](http://cr.openjdk.java.net/~gbierman/8246771/8246771-20200928/specs/local-statics-jls.html), section 9.6 Annotation Interfaces states that:
> 
> "It is a compile-time error if an annotation declaration is nested within the body of a local class or interface declaration (14.3), or within the body of an anonymous class"
> 
> javac is not implementing this assertion. The proposed patch is fixing this issue,
> 
> TIA

Marked as reviewed by jjg (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk16/pull/43


More information about the compiler-dev mailing list