[jdk17] RFR: 8254571: Erroneous generic type inference in a lambda expression with a checked exception
Vicente Romero
vromero at openjdk.java.net
Wed Jun 23 17:10:29 UTC 2021
On Wed, 23 Jun 2021 07:36:58 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java line 1242:
>>
>>> 1240: stuckVars.addAll(freeArgVars);
>>> 1241: depVars.addAll(inferenceContext.freeVarsIn(descType.getReturnType()));
>>> 1242: depVars.addAll(inferenceContext.freeVarsIn(descType.getThrownTypes()));
>>
>> did the same for method references given the similarities between both but I couldn't find a test case that reproduced the issue with a method reference
>
> How about:
>
> outer(nested(ConsiderExceptionTVarsInStuckExprs::mightThrow2));
> ...
> static <C> void mightThrow2(C c) throws Exception {}
yep that one makes the trick, thanks
-------------
PR: https://git.openjdk.java.net/jdk17/pull/91
More information about the compiler-dev
mailing list