RFR: Fix compilation failure after #229

Nir Lisker nlisker at openjdk.org
Sun Apr 7 21:12:09 UTC 2024


On Sun, 7 Apr 2024 20:59:16 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Changes in https://github.com/openjdk/jextract/pull/229 result in a compilation failure.
> 
> A cast that looks redundant was removed, but is actually needed for the code to compile.

Marked as reviewed by nlisker (no project role).

I used Eclipse to compile and it's known to not treat generics exactly the same as javac, so it reported this as an unneeded cast while javac thinks it's needed. I think that Eclipse is correct here, but since the code needs to run on javac we need to appease it.

Still, `case Double -> double.class;` is fine, but

case LongDouble -> {
    if (TypeImpl.IS_WINDOWS) {
        yield double.class;
    }

isn't? They yield the same type.

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

PR Review: https://git.openjdk.org/jextract/pull/230#pullrequestreview-1985253005
PR Comment: https://git.openjdk.org/jextract/pull/230#issuecomment-2041610152


More information about the jextract-dev mailing list