Skip to content

Fix requalifying type variable uses during viewpoint adaptation#799

Open
aosen-xiong wants to merge 28 commits into
eisop:masterfrom
aosen-xiong:haifeng-viewpointAdpatOnGenerics
Open

Fix requalifying type variable uses during viewpoint adaptation#799
aosen-xiong wants to merge 28 commits into
eisop:masterfrom
aosen-xiong:haifeng-viewpointAdpatOnGenerics

Conversation

@aosen-xiong

@aosen-xiong aosen-xiong commented Jun 27, 2024

Copy link
Copy Markdown
Collaborator

Cherry-picked change from #614.

This PR fixes viewpoint adaptation when requalifying type variable uses.

It preserves the real use-site annotation on type variables like @A E while adapting their bounds, so annotated uses correctly override the actual type argument and unannotated uses like E still keep the actual type argument annotation. It also avoids dropping annotations from unrelated qualifier hierarchies.

@wmdietl wmdietl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for picking this up!

Comment thread framework/tests/viewpointtest/AnnoOnTypeVariableUse.java Outdated
@wmdietl wmdietl changed the title Fix viewpoint adpat on generics Fix viewpoint adaptation of type variables Jun 28, 2024
@aosen-xiong aosen-xiong requested a review from wmdietl July 3, 2024 18:27
@aosen-xiong aosen-xiong assigned wmdietl and unassigned aosen-xiong Jul 3, 2024
Comment thread framework/tests/viewpointtest/AnnoOnTypeVariableUse.java Outdated
@wmdietl wmdietl assigned aosen-xiong and unassigned wmdietl Jul 7, 2024
@aosen-xiong aosen-xiong assigned wmdietl and unassigned aosen-xiong Sep 8, 2024
@aosen-xiong

Copy link
Copy Markdown
Collaborator Author

Maybe this PR could be better after we formalized @sub and introduce it into the implementation.

@wmdietl wmdietl mentioned this pull request Jan 3, 2025
@wmdietl

wmdietl commented Jan 5, 2025

Copy link
Copy Markdown
Member

Maybe this PR could be better after we formalized @sub and introduce it into the implementation.

Adding @sub support will be a larger task. This should just fix the substitution for the current system.

@wmdietl wmdietl assigned aosen-xiong and unassigned wmdietl Jan 5, 2025
@wmdietl

wmdietl commented Jan 5, 2025

Copy link
Copy Markdown
Member

Is this PR ready for review?

Copilot AI review requested due to automatic review settings June 15, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@aosen-xiong aosen-xiong changed the title Fix viewpoint adaptation of type variables Fix requalifying type variable uses during viewpoint adaptation Jun 15, 2026
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.

4 participants