Repository navigation
[java] Fix #6768: Resolve record component types before inference - #6871
Merged
UncleOwen merged 4 commits intoJul 16, 2026
Merged
Conversation
Contributor
|
Compared to main: (comment created at 2026-07-16 13:18:14+00:00 for 6ef1b53) |
DragonFSKY
marked this pull request as ready for review
July 14, 2026 14:13
UncleOwen
approved these changes
Jul 16, 2026
UncleOwen
left a comment
Member
There was a problem hiding this comment.
Thanks!
(I've moved the new test to the bottom, both because it's new and more specific than the existing one)
Contributor
Author
|
Thanks for the review and for moving the new test into the more specific section! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the PR
Record component types were excluded from early type-header disambiguation so
that record members remain in scope in the record header. However, their type
nodes were not disambiguated after the record body symbol table was installed.
When an anonymous-class argument causes type inference to inspect a sibling
implicit record accessor, the accessor return type therefore reads an unresolved
ASTClassTypeand throws anIllegalStateException.This PR disambiguates only the record component type nodes after applying the
record body scope and before processing body declarations. It also adds a
regression test based on the original reproducer.
This prevents the processing error without changing record accessor or type
inference behavior.
Related issues
Validation
(
283f0cba781c2057276cf4049bbe0c4878e9e8ea), exit code 5SymbolTableResolveragainst the same snapshot andconfirmed the reproducer completes with exit code 0
record component cases
./mvnw -pl pmd-java -am -Dtest=SymbolTableResolverTest -Dsurefire.failIfNoSpecifiedTests=false test(2 tests, 0 failures, 0 errors)
./mvnw -pl pmd-java -am test(9,751 PMD Java tests, 0 failures, 0 errors, 20 skipped)
./mvnw clean verify(all 44 reactor modules succeeded)git diff --checkReady?
./mvnw clean verifypasses