-
Bug
-
Resolution: Fixed
-
P4
-
repo-valhalla
-
generic
-
generic
The following program should print null, but instead ends up with a primitive class instance due to incorrect code generation.
public primitive class X {
public static void main(String [] args) {
Object o = X.ref.default;
System.out.println(o);
}
}
JEP401 states: "Every type has a default value, used to populate newly-allocated fields and array components of that type. " which affirms that
X.ref.default should actually be null since that is the default value
of primitive reference types.
public primitive class X {
public static void main(String [] args) {
Object o = X.ref.default;
System.out.println(o);
}
}
JEP401 states: "Every type has a default value, used to populate newly-allocated fields and array components of that type. " which affirms that
X.ref.default should actually be null since that is the default value
of primitive reference types.