Incorrect compilation issue reported by the plugin while using the records.
Since the latest version of IntelliJ, the IDE has started supporting Records in Java introduced as a preview feature in Java-14.
There should be no compile error reported by the plugin based on the .class generated.
IDEA Version:
IntelliJ IDEA 2020.1 EAP (Community Edition)
Build #IC-201.6487.11, built on March 18, 2020
Runtime version: 11.0.6+8-b765.15 x86_64
macOS 10.14.6
Plugin Version:
0.29-EAP
record type as follows
@lombok.AllArgsConstructor
public record Java(String version) {
}
System.out.println(new Java("14").version());
I have reported a reproducible issue on Stackoverflow with the observation and behavior with and without the plugin installed in the IDE.
In general, seems like Lombok in itself needs to support Records as well - https://github.com/rzwitserloot/lombok/issues/2356
Yes, lombok doesn't support 'records' at the moment
Hi, is there an idea of when this would be supported? I see the same problem with java 16
Hi, it seems that Lombok supports Java 16 records https://github.com/projectlombok/lombok/issues/2356, any update?
@mplushnikov Any update on this?
This is currently the only block for us to adopt using Records in our projects.
Lombok support for Records was added in v1.18.20, so it should be possible to implement :smile:
Thanks!
What's the purpose of the @AllArgsConstructor annotation? Records already have such a constructor.
Are you hoping Lombok will just ignore the annotation in this case?
What's the purpose of the
@AllArgsConstructorannotation? Records already have such a constructor.Are you hoping Lombok will just ignore the annotation in this case?
I'm not sure how useful the @AllArgsConstructor annotation is on a record - in my case it's the @Builder i'd like :smiley:
@Builder support would be very helpful :)
https://youtrack.jetbrains.com/issue/IDEA-266513
Most helpful comment
Hi, it seems that Lombok supports Java 16 records https://github.com/projectlombok/lombok/issues/2356, any update?