Describe the bug
When compiling with OpenJDK25, if val is used more than once and the target platform is Java 8 or Java 9, all uses of val after the first result in errors like the following:
MutliVal.java:6: error: incompatible types: long cannot be converted to val
val two = 2L;
To Reproduce
MultiVal.java
import lombok.val;
public class MutliVal {
// This does not compile with JDK 25, Lombok 1.18.42 and --release 8 or --release 9.
public static void jdk25failure() {
val one = 1L;
val two = 2L;
}
}
Compiling:
javac MutliVal.java -classpath lombok.jar -proc:full --release 8
Expected behavior
Compilation to succeed as it does with JDK 21 and earlier.
Version info (please complete the following information):
- Lombok version - 1.18.42
- Platform - javac 25
Additional context
n/a
Describe the bug
When compiling with OpenJDK25, if
valis used more than once and the target platform is Java 8 or Java 9, all uses of val after the first result in errors like the following:To Reproduce
MultiVal.java
Compiling:
Expected behavior
Compilation to succeed as it does with JDK 21 and earlier.
Version info (please complete the following information):
Additional context
n/a