[code-reflection] RFR: Unary plus

Paul Sandoz psandoz at openjdk.org
Wed Aug 14 18:21:59 UTC 2024


On Wed, 14 Aug 2024 14:51:24 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> So, these conversions are actually mandated because: the operand is a reference, so "promoting" means doing "unboxing". Then, the "promoted type" is just `int` (the primitive type), and that is the type of the `+v` expression. But then you need to rebox to respect the return type. So this is all good (albeit admittedly odd).

Yes, that was the intent of this test. Since the unary `+` is a no-op i wanted to ensure we still do the numeric promotion and we don't optimize it away. I will add a some brief comments to the tests.

-------------

PR Comment: https://git.openjdk.org/babylon/pull/213#issuecomment-2289526960


More information about the babylon-dev mailing list