Skip to content

Conversation

vicente-romero-oracle
Copy link
Contributor

@vicente-romero-oracle vicente-romero-oracle commented Oct 6, 2025

still a work in progress


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8368795: [lworld] javac rejects assignments to components of array fields with initializers in the prologue (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1664/head:pull/1664
$ git checkout pull/1664

Update a local copy of the PR:
$ git checkout pull/1664
$ git pull https://git.openjdk.org/valhalla.git pull/1664/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1664

View PR using the GUI difftool:
$ git pr show -t 1664

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1664.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 6, 2025

👋 Welcome back vromero! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 6, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.


@Override
public void visitIndexed(JCArrayAccess tree) {
boolean previewIsIndexed = isIndexed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean previousIsIndexed?

// Field may not have an initializer
if ((sym.flags() & HASINIT) != 0) {
reportPrologueError(tree, sym, true);
if (!sym.type.hasTag(ARRAY) || !isIndexed) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work for complex ones like (this.a = stuff)[b] = 5?

Maybe we can try updating isInLHS to point to a JCTree and all the tests to be something like tree == isInLHS so this just won't run for array indexed trees?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants