Clarification needed about primitive wrappers?
mcnepp02 at googlemail.com
Fri Jul 10 10:06:32 UTC 2020
it seems some clarification is needed about the fate of the primitive
wrappers in "Valhalla-world".
In this and the related Mailing Lists, you can find the following two
proposals, with subtle differences:
1. the primitive wrappers (java.lang.Integer etc) are designated to become
inline classes. This idea has been most recently cited in the posting
"Identity warnings for inline class candidates".
2. the primitive wrappers should become the reference-projections of
corresponding inline classes. This has sometimes been augmented with the
idea that the denominations for the primitive types (such as "int") will
then become aliases for those new inline types.
So, what's it going to be?
Right now, only proposal 2 makes much sense to me, because proposal 1 would
simply add a second, redundant "inline" type for each primitive (also
inherently "inline") type.
But then, if we are going with proposal 2, what would be so special about
the reference-projections of the primitive types? Shouldn't all reference
projects be treated equally?
Wouldn't it mean that synchronizing on an IdentityObject obtained via
reference-projection should always warrant a warning?
It may well be that all this is perfectly clear to you experts, however, it
might still be advantageous to use consistent wording everywhere!
More information about the valhalla-spec-observers