RFR: 8295019: Cannot call a method with a parameter of a local class declared in a lambda [v4]

Maurizio Cimadamore mcimadamore at openjdk.org
Sat Feb 4 00:44:03 UTC 2023


On Sat, 4 Feb 2023 00:37:40 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   a more general approach to cover every expression
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java line 442:
> 
>> 440:         try {
>> 441:             localEnv.info.returnResult = resultInfo;
>> 442:             /* we should be on the safe side for lambdas that declare a local type as it could be that the cache
> 
> I'd suggest a more succinct comment - e.g.:
> 
> 
> When performing speculative attribution on an argument expression, we should make sure that argument type cache does not get polluted with local types, as that leads to spurious type errors (see JDK-8295019)

Also, perhaps we should move this comment on the `attribSpeculative` method.

-------------

PR: https://git.openjdk.org/jdk/pull/12303


More information about the compiler-dev mailing list