RFR: 8260892: Compilation fails: lambda parameter not visible in body when generics involved

Vicente Romero vromero at openjdk.org
Wed Aug 3 19:48:06 UTC 2022


On Wed, 3 Aug 2022 18:25:03 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> This bug is being produced because as the diamond expression can't be attributed until the inference has been done. A listener is registered in the corresponding inference context but the way the current environment is being copied into `dupLocalEnv` produces a copy that shares info with the outer lambda expression. The lambda expression removes the argument from the shared scope before the listener is fired and thus the error. The proposal is to use a different way to copy the environment into `dupLocalEnv` by producing a brand new scope.
>> 
>> TIA
>
> Looks reasonable to me.

thanks for the review @lahodaj

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

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


More information about the compiler-dev mailing list