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
Something seems to go wrong with type reference parsing within method bodies when extends is involved. The following fails with the included stack trace:
Launcher.parseClass(""" public class Test { public static void test() { final Supplier<Object> supplier = () -> { final Supplier<? extends Function<?, Object>> supplier1 = () -> a -> a; return supplier1; }; } }""");
However, each of the following succeed:
Launcher.parseClass(""" public class Test { public static void test() { final Supplier<Object> supplier = () -> { final Supplier<Function<?, Object>> supplier1 = () -> a -> a; return supplier1; }; } }""");
Launcher.parseClass(""" public class Test { public static void test() { final Supplier<Object> supplier = () -> { final Supplier<? extends Supplier<?>> supplier1 = () -> () -> new Object(); return supplier1; }; } }""");
Launcher.parseClass(""" public class Test { public static void test() { final Supplier<? extends Function<?, Object>> supplier = () -> a -> a; } }""");
In other words, it only seems to apply with the combination of the local definition being within a lambda, the extends being present, and the nested type being parameterized by more than one type (so that it is split on the comma when the outer one is being processed)
lukebemish
changed the title
[Bug]: ReferenceBuilder#getTypeReference logic fails within lambda bodies
[Bug]: Type reference building logic fails within lambda bodies
Sep 28, 2023
Describe the bug
Something seems to go wrong with type reference parsing within method bodies when
extends
is involved. The following fails with the included stack trace:However, each of the following succeed:
In other words, it only seems to apply with the combination of the local definition being within a lambda, the
extends
being present, and the nested type being parameterized by more than one type (so that it is split on the comma when the outer one is being processed)Actual output
Spoon Version
10.4.2-beta-4, tried on 10.4.1 as well
JVM Version
17.0.8.1
What operating system are you using?
Kubuntu
The text was updated successfully, but these errors were encountered: