Open mjustin opened 3 years ago
Duplicate of #2539
I already spend some time debugging that but it is not that easy as it is something that happens at the very end of the compilation which is not covered by unit tests. Great news that this works in Java 15, if I can figure out what they changed lombok might be able to fix that in Java 14 too.
Duplicate of #2539
I already spend some time debugging that but it is not that easy as it is something that happens at the very end of the compilation which is not covered by unit tests. Great news that this works in Java 15, if I can figure out what they changed lombok might be able to fix that in Java 14 too.
Thanks. I missed it when searching for existing issues, I think mainly because I was looking for generics specifically in my search.
Describe the bug
The build fails with a "compiler bug" when using
@Builder.Default
with an annotated generic type parameter on Java 14. This bug does not occur in Java 11 (the latest LTS version), 13, or 15.If the code is delomboked and then compiled, the code compiles successfully.
To Reproduce
Create a directory with the given
Test.java
file. Ensure you are using Java 14 (This was tested using the Hotspot AdoptOpenJDK version 14.0.2 as installed by SDKMAN! persdk install java 14.0.2.hs-adpt
).Test.java
Running Lombok against the test file throws an error. Delomboking the test file and running that does not throw any error.
Test commands
Expected behavior
The build should succeed, producing the same end result as when compiled on other versions of Java.
Version info (please complete the following information):
Additional context
It's very possible this is a
javac
bug as reported in the output, and not a Lombok one. However, as the delomboked code compiles I can't easily track down what that bug might be, as I'm not sure if it's reproducible with pure Java code, or what code would trigger the bug.Furthermore, since Java 14 is not a LTS and it works in Java 15, even if this is an issue with Lombok and not
javac
, it may not be worth fixing.