State of javac support for lworld-values.
Srikanth
srikanth.adayapalam at oracle.com
Tue Mar 27 01:10:48 UTC 2018
On Tuesday 27 March 2018 05:43 AM, John Rose wrote:
> As far as javac is concerned, until a type has made the leap into the
> value-type world, it is a reference type, and can pull all the crazy
> tricks
> that are permitted to references, even when they are in poor taste.
>
> Adding in new hard restrictions on a half-way point seems (IMO) to
> create a new entity in the Java type system, neither value nor
> reference, but something in between. I think we'd regret that.
> Soft restrictions will let us avoid such a hard commitment.
>
> The appropriate escape hatch is annotations, which are not allowed
> to change semantics (generally speaking) but are allowed to gate
> lint-like behavior. Karen's idea to mark VBC's is a good one, but it
> must be interpreted with one eye on existing reference semantics,
> which means that warnings (not errors) are the appropriate severity,
> akin to the raw-type and unchecked warnings on today's generics.
OK, I read the above as essentially an endorsement for a lenient mode in
javac for classes which are somehow recognized as having arrived from
valuedom after having inhabited the reference world - i.e value based
classes.
I was operating with missionary zeal that I managed to get infused in,
to minimize the surface area where null pollution may originate - I can
certainly attenuate that zeal :) A warning to Mr/Ms Programmer that
he/she is may be about to blow his/her foot and sit back and watch: can
be done.
(I still think javac's stern carping mode does not block the project
from the goals of using javac to write tests or do experiments in
separate compilation - by virtue of -source 10 mode, but I will look
into the lenient mode in earnest)
Srikanth
>
> — John
More information about the valhalla-dev
mailing list