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

Vicente Romero vromero at openjdk.org
Wed Aug 3 19:48:19 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

This pull request has now been integrated.

Changeset: 67f00118
Author:    Vicente Romero <vromero at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/67f001186b66b9fcbc9156012d1eec2ae5d45d8b
Stats:     52 lines in 2 files changed: 51 ins; 0 del; 1 mod

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

Reviewed-by: jlahoda

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

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


More information about the compiler-dev mailing list