On Mon, 1 Sep 2025 18:33:54 GMT, Maurizio Cimadamore <[email protected]> wrote:
> (in your example with static context, my answer is that no, it should _not_ > compile. A static context can't access instance fields from an enclosing > class) Yep, sorry that was a dumb example - I should have replaced the static context with a lambda. I'm all for increased flexibility, it's just that it would be nice if that came with a clean mental model. For example, one possible mental model could be "works like effectively final" - which I think is what you're advocating - but for that we'd have to break the equivalence between `y` and `A.this.y` (probably worth it). ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1523#discussion_r2314503944
