JDK-8309093 : Underscore with brackets
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-05-30
  • Updated: 2023-06-09
  • Resolved: 2023-06-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 21
21 b26Fixed
Related Reports
Relates :  
Description
The following snippet compiles, while the grammar prohibits it:

   for (int _[] : new int[][]{new int[]{1}, new int[]{2}}) { }
Comments
Changeset: 80075997 Author: Aggelos Biboudis <abimpoudis@openjdk.org> Committer: Jan Lahoda <jlahoda@openjdk.org> Date: 2023-06-02 06:14:57 +0000 URL: https://git.openjdk.org/jdk/commit/8007599756ad9052afaa64044bb4703e813dc080
02-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14217 Date: 2023-05-30 13:13:30 +0000
30-05-2023