[patterns] Spec 6.3.1 misses parenthesized expressions

Tagir Valeev amaembo at gmail.com
Thu Dec 26 07:47:28 UTC 2019


Reading draft [1] I see nothing about parenthesized expressions. I
expect that 6.3.1 should mention them:

If an expression is not a logical complement expression,
conditional-and expression, conditional-or expression, conditional
expression, **parenthesized expression**, or instanceof operator, then
no rules apply regarding the introduction of pattern variables.

6.3.1.7 Parenthesized Expressions

The following rules apply to a parenthesized expression (15.8.5):
V is introduced by (a) iff V is introduced by a.

Otherwise many simple examples involving patterns become obviously incorrect.

With best regards,
Tagir Valeev.

[1] http://cr.openjdk.java.net/~gbierman/jep305/jep305-20191021/specs/patterns-instanceof-jls.html#jls-6.3.1


More information about the amber-spec-experts mailing list