Skip to content

Extract ATF#get(Constructor/Method)ReceiverType helpers#1872

Open
wmdietl wants to merge 6 commits into
masterfrom
atf-helpers
Open

Extract ATF#get(Constructor/Method)ReceiverType helpers#1872
wmdietl wants to merge 6 commits into
masterfrom
atf-helpers

Conversation

@wmdietl

@wmdietl wmdietl commented Jul 16, 2026

Copy link
Copy Markdown
Member

Done while reviewing an earlier version of #1850 with Antigravity.

@aosen-xiong Is it worth keeping the two new helpers ATF#get(Constructor/Method)ReceiverType?

The extra test case is also useful.

aosen-xiong and others added 5 commits July 4, 2026 17:37
… utility methods

This commit fixes an issue where constructor type variable bounds were not being viewpoint-adapted correctly, mirroring the fix that was made for method invocations. It extracts 'getConstructorReceiverType' into a dedicated helper method, adds 'constructorTypeVariableBoundsFromUse', and utilizes it in 'BaseTypeVisitor.visitNewClass'. It also improves API usability by making both 'getMethodReceiverType' and 'getConstructorReceiverType' public and cross-referencing them in Javadocs.
Copilot AI review requested due to automatic review settings July 16, 2026 19:17

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.

methods.withArg(top);

// :: error: (type.arguments.not.inferred)
methods.withArg(a);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this line should not issue an error.

Let me think about how to combine this with #1850.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The test cases are from #1850 and I didn't touch them. The point of this branch is extracting the logic... which isn't re-used anymore (as it was in that earlier version of #1850), but it might still be nice to extract.

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.

3 participants