-
Bug
-
Resolution: Duplicate
-
P4
-
repo-valhalla
-
None
-
generic
-
generic, other, linux, linux_2.2
Compiling and running the following program results in an error:
java.lang.InternalError: must be primitive type: X
$ cat X.java
public value class X {
public static void main(String[] args) {
Object o = new X();
o.toString();
}
}
$ ~/gitreps/valhalla/build/linux-x86_64-server-release/images/jdk/bin/javac -g X.java
$ ~/gitreps/valhalla/build/linux-x86_64-server-release/images/jdk/bin/java X
Exception in thread "main" java.lang.InternalError: must be primitive type: X
at java.base/java.lang.runtime.PrimitiveObjectMethods.primitiveObjectHashCode(PrimitiveObjectMethods.java:439)
at java.base/java.lang.Object.hashCode(Native Method)
at java.base/java.lang.Object.toString(Object.java:269)
at X.main(X.java:4)
java.lang.InternalError: must be primitive type: X
$ cat X.java
public value class X {
public static void main(String[] args) {
Object o = new X();
o.toString();
}
}
$ ~/gitreps/valhalla/build/linux-x86_64-server-release/images/jdk/bin/javac -g X.java
$ ~/gitreps/valhalla/build/linux-x86_64-server-release/images/jdk/bin/java X
Exception in thread "main" java.lang.InternalError: must be primitive type: X
at java.base/java.lang.runtime.PrimitiveObjectMethods.primitiveObjectHashCode(PrimitiveObjectMethods.java:439)
at java.base/java.lang.Object.hashCode(Native Method)
at java.base/java.lang.Object.toString(Object.java:269)
at X.main(X.java:4)
- duplicates
-
JDK-8280746 [lworld] Initial core libraries support for value classes
-
- Resolved
-