RFR: 8260892: Compilation fails: lambda parameter not visible in body when generics involved
Jan Lahoda
jlahoda at openjdk.org
Wed Aug 3 18:28:47 UTC 2022
On Mon, 1 Aug 2022 23:37:39 GMT, Vicente Romero <vromero 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.
-------------
Marked as reviewed by jlahoda (Reviewer).
PR: https://git.openjdk.org/jdk/pull/9710
More information about the compiler-dev
mailing list