Skip to content

Align inference resolution with javac by applying hints from Maurizio#5129

Merged
stephan-herrmann merged 8 commits into
eclipse-jdt:masterfrom
stephan-herrmann:issue5004
Jun 14, 2026
Merged

Align inference resolution with javac by applying hints from Maurizio#5129
stephan-herrmann merged 8 commits into
eclipse-jdt:masterfrom
stephan-herrmann:issue5004

Conversation

@stephan-herrmann

Copy link
Copy Markdown
Contributor

This PR consolidates and replaces #5004.

See individual commits from description.

Improve the impl to cover one more issue
+ really make ivar-ivar dependencies bidirectional
+ consider all ivar-super bounds in ivar prioritization

Opportunistically fine tune usage of same bounds:
+ only during regular inference:
  + record inverse of same-bounds for use by rankIVar()
+ only during record pattern inference:
  + workaround for inverse same-bounds in rankIVar()

Still need to always use same-bounds during 2nd attempt of resolution

Minor corrections (moving code lines up/down)

Failures in
+ GenericsRegressionTest.test434118()
+ GenericsRegressionTest_9.testIssue4864()

Fixes eclipse-jdt#4937
  - GenericsRegressionTest.test434118
  - GenericsRegressionTest_9.testIssue4864
+ more propagation of isSoft flag (for consistency)
+ Revert part of commit dd34c06 from eclipse-jdt#4635:
  ARGUMENT_CONSTRAINTS_ARE_SOFT is back to false as recommended
- propagate failures during resolution of capture bounds
+ more documentation for JavacHasABug.JavacBug6573446
+ new constant JavacHasABug.JavacBugIvarInterning
+ new constant JavacHasABug.JavacBug8297428
At this point GenericsRegressionTest_9 is ready to opt in to this mode
+ let unsuccessful glb proceed to 2nd attempt rather than failing
@stephan-herrmann stephan-herrmann merged commit 6894bfa into eclipse-jdt:master Jun 14, 2026
13 checks passed
@stephan-herrmann stephan-herrmann deleted the issue5004 branch June 14, 2026 17:26
@stephan-herrmann stephan-herrmann added this to the 4.41 M1 milestone Jun 14, 2026
@stephan-herrmann

stephan-herrmann commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

I wrapped up this issue where many fixes / improvements had piled up.

@srikanth-sankaran @coehlrich the recent work on code level comparison with javac has provided valuable input for this PR, in that none of the cases we investigated raised doubts about the changes here (I ran all recent comparisons with ecj as of this PR). THANKS!

So these are closed now as well:

Revisiting the following cases deviation from javac has been documented using an Excuse:

These are still in the pipeline for clarification with Oracle:

Follow up

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant