[code-reflection] RFR: Issue errors when quotable constructs are found inside inner classes
Maurizio Cimadamore
mcimadamore at openjdk.org
Mon Jul 7 21:22:53 UTC 2025
On Mon, 7 Jul 2025 21:14:55 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> How feasible would it be to, eventually, do this?
To reply more directly to your question: we already have code to generate a model like that -- when we generate a model for quotable lambdas, we add extra parameters to the model to map enclosing `this` (where available) as well as any captured vars. We could do exactly the same for any method declared inside an inner class. In terms of code we can do it -- but this wouldn't model the semantics of the code eventually generated by javac (perhaps this become clearer when thinking about how such an approach would scale to model the _constructor_ of an inner class).
-------------
PR Comment: https://git.openjdk.org/babylon/pull/486#issuecomment-3046556052
More information about the babylon-dev
mailing list