Withdrawn: 8256266: Binding variables don't correct support declaration annotations and the final modifier
Jan Lahoda
jlahoda at openjdk.java.net
Tue Jan 12 16:47:57 UTC 2021
On Thu, 12 Nov 2020 16:47:48 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> Basically, javac does not handle code like this properly:
>
> import java.lang.annotation.*;
>
> public class B {
> public void test(Object o) {
> if (o instanceof @A String s) {}
> }
> }
>
> @Target(ElementType.LOCAL_VARIABLE)
> @interface A {}
>
> The parser needs to allow declaration annotations on binding variables, see:
> http://cr.openjdk.java.net/~gbierman/jep394/jep394-20201012/specs/patterns-instanceof-jls.html#jls-14.30.1.1
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1192
More information about the compiler-dev
mailing list