[jdk17] Integrated: 8268961: Parenthesized pattern with guards does not work
Jan Lahoda
jlahoda at openjdk.java.net
Wed Jun 23 10:20:43 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
This pull request has now been integrated.
Changeset: bf706207
Author: Jan Lahoda <jlahoda at openjdk.org>
URL: https://git.openjdk.java.net/jdk17/commit/bf706207454d8aea57049189befdf2a08e6d1291
Stats: 274 lines in 8 files changed: 244 ins; 19 del; 11 mod
8268961: Parenthesized pattern with guards does not work
8268896: Parenthesized pattern is not guarded by source level check
Reviewed-by: vromero
-------------
PR: https://git.openjdk.java.net/jdk17/pull/116
More information about the compiler-dev
mailing list