You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the keyword static is added to the record-class definition, the code compiles as expected.
Expected behavior
The code should compile without the static keyword as well, as record-classes are static implicitly.
Version info (please complete the following information):
Lombok version 1.18.28
Platform mac-os / java 17
openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment JBR-17.0.5+8-738-jcef (build 17.0.5+8-b738)
OpenJDK 64-Bit Server VM JBR-17.0.5+8-738-jcef (build 17.0.5+8-b738, mixed mode)
Additional context
delomboking via the lombok.jar shows the following variants between explicit-static and implicit-static
implicit-static
recordInnerRecord(intaComponent) {
/** * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed). */@java.lang.SuppressWarnings("all")
publicOuterClass<V>.InnerRecordwithAComponent(finalintaComponent) {
returnthis.aComponent == aComponent ? this : newOuterClass<V>.InnerRecord(aComponent);
}
}
explicit-static
staticrecordInnerRecord(intaComponent) {
/** * @return a clone of this object, except with this updated property (returns {@code this} if an identical value is passed). */@java.lang.SuppressWarnings("all")
publicOuterClass.InnerRecordwithAComponent(finalintaComponent) {
returnthis.aComponent == aComponent ? this : newOuterClass.InnerRecord(aComponent);
}
}
It seems to be the case, that the implicitly-static record isn't detected as being static, causing lombok to produce references to OuterClass including the generic parameter V, which would only be bound in a non-static context.
The text was updated successfully, but these errors were encountered:
Describe the bug
Compilation of a java-source file fails, if
@With
static
This seems to be related to #3140 but still occurs in lombok 1.18.28
To Reproduce
Compile the following source file
Observe compilation failure
A reproduction example project is available in gist https://gist.github.com/pmenke-de/28d8793052f51cc1f6d16c09b6ced1c4
If the keyword
static
is added to the record-class definition, the code compiles as expected.Expected behavior
The code should compile without the
static
keyword as well, as record-classes are static implicitly.Version info (please complete the following information):
Additional context
delomboking via the lombok.jar shows the following variants between explicit-
static
and implicit-static
implicit-
static
explicit-
static
It seems to be the case, that the implicitly-
static
record isn't detected as being static, causing lombok to produce references toOuterClass
including the generic parameterV
, which would only be bound in a non-static context.The text was updated successfully, but these errors were encountered: