Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for type arguments of the generic functions in jdt #327

Merged
merged 2 commits into from
Jan 20, 2024

Conversation

pouryafard75
Copy link
Contributor

@pouryafard75 pouryafard75 commented Jan 19, 2024

This PR aims to fix issue #323.

TypeArguments of the method invocation are ignored after the introduction of MethodInvocationReceiver in 3.0 gen.jdt.
Since java only allows to pass the type argument in case of having the receiver, I thought its better to have the reciver as the parent of the type arguments. In other words:

<String> emptyList()                         --> This runs into compilation error ❌
Collections.<String> emptyList()  --> Works fine ✅

Also, typeArguments seem to be an empty list (not null) in case of having basic method invocations. So there is no need for additional null check.
I have also added a test to capture the newly added subtree.

@jrfaller
Copy link
Member

Hi @pouryafard75 and thanks a lot for the PR!

LGTM! merging.

@jrfaller jrfaller merged commit 190aed8 into GumTreeDiff:main Jan 20, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants