RFR: 8359335: Template-Framework Library: Primitive Types subtyping
Emanuel Peter
epeter at openjdk.org
Mon Jan 26 15:37:50 UTC 2026
On Fri, 23 Jan 2026 16:04:24 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:
> > I wasn't aware. Do you have an example?
>
> `testlibrary_tests/template_framework/tests/TestExpression.java` will fail with `Template rendering mismatch`. I tried it before I added the exception to the float division operators.
Ah ok. But that is because we'd be changing the semantics of the API, so then we'd have to adjust testing too. Not surprising. As you said above: easy to fix.
> > just the fear that we will continue to hit subtle bugs, and it's just not worth it?
>
> Mainly this
I don't care enough about a single operator. Personally, I'd like to have one version that does not have the annotation. But it can be the one with explicit casts to float/double for the arguments. Just so we can generate a float mod without catching exceptions.
> > we could also add explicit float/double casts to the modulo operator arguments. That would at least force away any exception, and ensure we are choosing the float/double modulo, rather than int modulo.
>
> I like this. Then the question is, whether we want both or only the one with or the one without the annotation.
Might as well add both, and some comments. I would agree to that :)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29349#issuecomment-3800229996
More information about the hotspot-compiler-dev
mailing list