hg: jdk7/tl/langtools: 6979683: inconsistent interaction of reference cast with box/unbox conversions leaves out a useful case

John Rose john.r.rose at oracle.com
Wed Sep 1 18:54:18 PDT 2010

On Sep 1, 2010, at 6:31 PM, Neal Gafter wrote:

> I also can't find any general rule about casting being allowed to do the reverse of multi-step conversions, which seems to be your "bottom line" justification.

By your reading, what is the spec. support for (Object)(int)x? (I.e., (Object)n, where 'n' is 'int'?)

I think the spec. support for (Object)(int) is the use of combined steps from the first para. of 5.5.

If that is the case, there is no reason to deny (int)(Object) its place in the twilight.

(Yes, I agree the spec. is gray here.  There is an umbrella proposal to bring clarity to it, mentioned in the final paragraph of my bug report.)

Do you have an alternative reading of the spec. that allows (Object)(int) but not (int)(Object)?

-- John

More information about the compiler-dev mailing list