[lworld] RFR: 8359370: [lworld] allow instance fields of identity classes to be readable in the prologue phase [v13]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Aug 29 11:00:56 UTC 2025


On Fri, 29 Aug 2025 10:10:06 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> if one has a complex select like for example: `new SuperInitFails(){}.x` it is still necessary to look inside and see if there are some forbidden accesses
>
> Ok, the issue might then be that, while looking inside `SuperInitFails` you find a plain early access to a field (e.g. an ident) and we end up skipping it because `analyzingSelect` is set. At the very least we should unset inside classes (maybe lambdas too).

Example:


class Test {

    int x = 4;

    static String m(Runnable r) { return null; }

    Test() {
        m(() -> System.out.println(x)).toString();
        super();
    }

    public static void main(String[] args) {
        new Test();
    }
}


This seems to compile, but then fails with verifier error.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1523#discussion_r2309859203


More information about the valhalla-dev mailing list