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

feat: Use inferred generic type in invocations #4844

Conversation

I-Al-Istannen
Copy link
Collaborator

@I-Al-Istannen I-Al-Istannen commented Aug 16, 2022

If no explicit type arguments are given, the type arguments JDT inferred are now used for getActualTypeArguments.

This addresses #4834 #4838, but I am not sure we actually want to use the inferred information. It seems quite useful, but it may also be incomplete if JDT is not able to infer things correctly.

If no explicit type arguments are given, the type arguments JDT inferred
are now used for getActualTypeArguments.
@MartinWitt MartinWitt requested a review from SirYwell August 16, 2022 21:58
@I-Al-Istannen I-Al-Istannen changed the title wip: feat: Use inferred generic type in invocations review: feat: Use inferred generic type in invocations Aug 17, 2022
Copy link
Collaborator

@SirYwell SirYwell left a comment

Choose a reason for hiding this comment

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

I think it makes sense to use the information in the model. While it makes the printer a bit more complex, it helps with analysing code. I think we should look into more places where we don't use implicit information.

For the PrintTypeArguments I'd prefer to either find better suited names or document it properly. It also looks like the writeActualTyoeArguments() method is public, so I'm not sure if we can just add a parameter to it.

@I-Al-Istannen
Copy link
Collaborator Author

I overloaded it, so existing callers and subclasses should be fine. I also renamed them and added some documentation, maybe that's nicer now?

Copy link
Collaborator

@SirYwell SirYwell left a comment

Choose a reason for hiding this comment

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

Yes, that's better

@MartinWitt MartinWitt changed the title review: feat: Use inferred generic type in invocations feat: Use inferred generic type in invocations Aug 22, 2022
@MartinWitt MartinWitt merged commit 67f28a9 into INRIA:master Aug 22, 2022
@MartinWitt
Copy link
Collaborator

Thanks @I-Al-Istannen

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