-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8315532: Compiler Implementation for Unnamed Variables & Patterns
8317221: Implementation for javax.lang.model for Unnamed Variables & Patterns Co-authored-by: Jan Lahoda <jlahoda@openjdk.org> Co-authored-by: Maurizio Cimadamore <mcimadamore@openjdk.org> Co-authored-by: Gavin Bierman <gbierman@openjdk.org> Co-authored-by: Brian Goetz <briangoetz@openjdk.org> Co-authored-by: Joe Darcy <darcy@openjdk.org> Co-authored-by: Aggelos Biboudis <abimpoudis@openjdk.org> Reviewed-by: jlahoda, mcimadamore
- Loading branch information
1 parent
3934127
commit c9d23c3
Showing
38 changed files
with
195 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
T8314216.java:13:23: compiler.err.invalid.case.label.combination | ||
T8314216.java:14:28: compiler.err.invalid.case.label.combination | ||
- compiler.note.preview.filename: T8314216.java, DEFAULT | ||
- compiler.note.preview.recompile | ||
2 errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
T8314423.java:15:24: compiler.err.preview.feature.disabled.plural: (compiler.misc.feature.unnamed.variables) | ||
1 error | ||
T8314423.java:15:24: compiler.err.feature.not.supported.in.source.plural: (compiler.misc.feature.unnamed.variables), 21, 22 | ||
1 error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
test/langtools/tools/javac/TryWithResources/TwrLintUnderscore.out
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
test/langtools/tools/javac/diags/examples/UnnamedVariables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
// key: compiler.err.feature.not.supported.in.source.plural | ||
// key: compiler.misc.feature.unnamed.variables | ||
// options: -Xlint:-options --source 21 | ||
|
||
class UnnamedVariables { | ||
void test() { | ||
String _ = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
test/langtools/tools/javac/diags/examples/UseOfUnderscoreNotAllowedNonVar.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
// key: compiler.err.use.of.underscore.not.allowed.non.variable | ||
|
||
import java.util.function.*; | ||
|
||
class UseOfUnderscoreNotAllowedNonVar { | ||
IntBinaryOperator f = (int x, int y) -> _ + x; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 36 additions & 38 deletions
74
...s/tools/javac/lambda/IdentifierTest21.out → ...s/tools/javac/lambda/IdentifierTest22.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,38 @@ | ||
IdentifierTest.java:42:11: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:45:16: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:47:22: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:52:13: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:52:23: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:54:13: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:56:13: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:64:67: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:71:13: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:72:14: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:73:18: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:80:13: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:80:15: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:82:13: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:82:15: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:89:10: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:89:38: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:95:14: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:102:17: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:102:26: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:119:20: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:124:10: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:129:17: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:132:17: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:139:24: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:139:33: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:140:39: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:145:15: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:146:13: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:151:15: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:152:17: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:42:11: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:45:16: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:47:22: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:52:13: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:52:23: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:54:13: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:56:13: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:64:67: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:71:13: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:72:14: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:73:18: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:80:13: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:80:15: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:82:13: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:82:15: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:89:10: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:89:38: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:95:14: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:102:17: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:102:26: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:119:20: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:124:10: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:129:17: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:132:17: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:139:24: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:139:33: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:140:39: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:145:15: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:146:13: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:151:15: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:152:17: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:158:16: compiler.err.use.of.underscore.not.allowed.with.brackets | ||
IdentifierTest.java:160:25: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:169:5: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:173:26: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:175:19: compiler.err.use.of.underscore.not.allowed | ||
IdentifierTest.java:181:11: compiler.err.use.of.underscore.not.allowed | ||
- compiler.note.preview.filename: IdentifierTest.java, DEFAULT | ||
- compiler.note.preview.recompile | ||
IdentifierTest.java:160:25: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:169:5: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:173:26: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:175:19: compiler.err.use.of.underscore.not.allowed.non.variable | ||
IdentifierTest.java:181:11: compiler.err.use.of.underscore.not.allowed.non.variable | ||
37 errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
c9d23c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Issues