-
Bug
-
Resolution: Not an Issue
-
P4
-
repo-valhalla
-
generic
-
generic
As things exist there are a bunch of problems with the following API points in Valhalla:
(1) com.sun.tools.javac.code.Type.ClassType#isReference always returns true - For primitive class types it should not be return true
(2) Likewise com.sun.tools.javac.code.Type.TypeVar#isReference
and com.sun.tools.javac.code.Type.WildcardType#isReference always return true. What is it is T/? extends PrimitiveObject ??
(3) Likewise all implementations of com.sun.tools.javac.code.Type#isNullOrReference needs to be inspected to see if they do the reasonable thing.
(4) Type.isValueProjection() is missing
(5) Maurizio's observations in https://github.com/openjdk/valhalla/pull/482:
"leaving a method in Types called isPrimitiveClass which takes a type and return false when the type is derived from a primitive class seems suboptimal. See my comment on Type::isPrimitiveClass. I think what you want there is probably isPrimitiveType. or isValueType or something like that - stay away from Class."
(My response there:
"Since we already have com.sun.tools.javac.code.Type#isPrimitive it is useful to retain to "Class" somewhere in the new APIs name although perhaps not in the present form of Type#isPrimitiveClass()
Perhaps the old method should be renamed to isBasicPrimitive() and the new one should be isPrimitiveClassType()")
(6) Maurizio asks in https://github.com/openjdk/valhalla/pull/482:
I think we should probably change the metamorphose name to a more neutral one like update ?(com.sun.tools.javac.code.Type.ClassType.Flavor#metamorphose)
[add others]
(1) com.sun.tools.javac.code.Type.ClassType#isReference always returns true - For primitive class types it should not be return true
(2) Likewise com.sun.tools.javac.code.Type.TypeVar#isReference
and com.sun.tools.javac.code.Type.WildcardType#isReference always return true. What is it is T/? extends PrimitiveObject ??
(3) Likewise all implementations of com.sun.tools.javac.code.Type#isNullOrReference needs to be inspected to see if they do the reasonable thing.
(4) Type.isValueProjection() is missing
(5) Maurizio's observations in https://github.com/openjdk/valhalla/pull/482:
"leaving a method in Types called isPrimitiveClass which takes a type and return false when the type is derived from a primitive class seems suboptimal. See my comment on Type::isPrimitiveClass. I think what you want there is probably isPrimitiveType. or isValueType or something like that - stay away from Class."
(My response there:
"Since we already have com.sun.tools.javac.code.Type#isPrimitive it is useful to retain to "Class" somewhere in the new APIs name although perhaps not in the present form of Type#isPrimitiveClass()
Perhaps the old method should be renamed to isBasicPrimitive() and the new one should be isPrimitiveClassType()")
(6) Maurizio asks in https://github.com/openjdk/valhalla/pull/482:
I think we should probably change the metamorphose name to a more neutral one like update ?(com.sun.tools.javac.code.Type.ClassType.Flavor#metamorphose)
[add others]