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
Describe the bug
Attempting to use val can cause a stack overflow within Lombok in certain cases.
In the miminal example below, the issue is an interface with a recursive generic type. The problem only arises in this specific case -- many minor changes to the code will bypass it (e.g. changing the method parameter to a raw Thing, or giving it a concrete type such as Thing<Integer>, or changing the interface type to <T extends Comparable<T>> or <T extends Comparable<?>> will all cause the code to compile successfully).
To Reproduce
import lombok.val;
public class Example {
public void run(Thing<?> thing) {
val x = thing;
}
}
interface Thing<T extends Comparable<? super T>> {}
Expected behavior
Lombok infers the type of x as Thing<?>, or emits an informative error if it is unable to handle this case by design.
Version info (please complete the following information):
Lombok version 1.18.12 (and all the earlier versions I tried, back to 1.12.2)
Platform: javac 1.8.0_211 and javac 11.0.4-ojdkbuild
Additional context
The stack trace I get (for javac 11, Lombok 1.18.12) is:
java.lang.StackOverflowError
at lombok.javac.JavacResolution.typeToJCTree0(JavacResolution.java:322)
at lombok.javac.JavacResolution.typeToJCTree(JavacResolution.java:308)
at lombok.javac.JavacResolution.typeToJCTree0(JavacResolution.java:373)
at lombok.javac.JavacResolution.typeToJCTree(JavacResolution.java:308)
at lombok.javac.JavacResolution.typeToJCTree0(JavacResolution.java:366)
at lombok.javac.JavacResolution.typeToJCTree(JavacResolution.java:308)
at lombok.javac.JavacResolution.genericsToJCTreeNodes(JavacResolution.java:412)
at lombok.javac.JavacResolution.typeToJCTree0(JavacResolution.java:402)
GOTO 10
The text was updated successfully, but these errors were encountered:
Describe the bug
Attempting to use val can cause a stack overflow within Lombok in certain cases.
In the miminal example below, the issue is an interface with a recursive generic type. The problem only arises in this specific case -- many minor changes to the code will bypass it (e.g. changing the method parameter to a raw
Thing
, or giving it a concrete type such asThing<Integer>
, or changing the interface type to<T extends Comparable<T>>
or<T extends Comparable<?>>
will all cause the code to compile successfully).To Reproduce
Expected behavior
Lombok infers the type of
x
asThing<?>
, or emits an informative error if it is unable to handle this case by design.Version info (please complete the following information):
Additional context
The stack trace I get (for javac 11, Lombok 1.18.12) is:
The text was updated successfully, but these errors were encountered: