Bug report with lworld / jshell
Brian Goetz
brian.goetz at oracle.com
Fri Jul 5 16:24:18 UTC 2019
In JShell, I did the following:
jshell -C-XDallowGenericsOverValues
| Welcome to JShell -- Version 14-internal
| For an introduction type: /help intro
jshell> inline class V { int x; int y; V(int x, int y) { this.x = x;
this.y = y; } }
| Warning:
| Modifier 'final' not permitted in top-level declarations, ignored
| inline class V { int x; int y; V(int x, int y) { this.x = x; this.y =
y; } }
|
^--------------------------------------------------------------------------^
| created class V
// The warning is confusing, but not terrible.
jshell> V v = new V(1,2)
v ==> [V x=1 y=2]
jshell> V? vv = v
vv ==> [V x=1 y=2]
jshell> v
v ==> [V x=1 y=2]
jshell> vv
| Exception java.lang.NoSuchFieldError: vv
| at (#5:1)
The last seems a JShell bug.
More information about the valhalla-dev
mailing list