RFR: 8309235: Unnamed Variables (_) can't be used in JShell

Aggelos Biboudis abimpoudis at openjdk.org
Tue Jun 6 15:12:56 UTC 2023


This PR addresses the issue of JShell not accepting unnamed local variables. This solution prints all local variables via the `/vars` command. e.g.,


jshell> int _ = 42;
 ==> 42

jshell> int _ = 43;
 ==> 43

jshell> String _ = "44";
 ==> "44"

jshell> /vars
|    int _ = 42
|    int _ = 43
|    String _ = "44"

-------------

Commit messages:
 - Remove whitespace
 - 8309235: Unnamed Variables (_) can't be used in JShell

Changes: https://git.openjdk.org/jdk/pull/14337/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14337&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8309235
  Stats: 92 lines in 8 files changed: 77 ins; 1 del; 14 mod
  Patch: https://git.openjdk.org/jdk/pull/14337.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/14337/head:pull/14337

PR: https://git.openjdk.org/jdk/pull/14337


More information about the kulla-dev mailing list