[jdk17] RFR: 8268961: Parenthesized pattern with guards does not work
Vicente Romero
vromero at openjdk.java.net
Tue Jun 22 18:59:27 UTC 2021
On Tue, 22 Jun 2021 13:02:40 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> This PR fixes a couple of problems related to parenthesized patterns:
> a) as noted in https://bugs.openjdk.java.net/browse/JDK-8268961, javac does not accept guards after parenthesized patterns (e.g. `(String s) && s.isEmpty()`, although it should.
> b) related to that, the disambiguation determining whether a case label is a pattern or an expression is not working well for cases like `a >> b`, which will be interpreted as a pattern (while it may be a valid expression)
> c) related to that, handling of parenthesized patterns in Attr should also be better - the raw type warning should be reported for all type patterns, even those inside a guarded pattern
> d) the source level check was missing on one place for parenthesized patterns, as noted in https://bugs.openjdk.java.net/browse/JDK-8268896
looks sensible
-------------
Marked as reviewed by vromero (Reviewer).
PR: https://git.openjdk.java.net/jdk17/pull/116
More information about the compiler-dev
mailing list