-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
feat: Use inferred generic type in invocations #4844
Conversation
If no explicit type arguments are given, the type arguments JDT inferred are now used for getActualTypeArguments.
There was a problem hiding this 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.
src/main/java/spoon/reflect/visitor/DefaultJavaPrettyPrinter.java
Outdated
Show resolved
Hide resolved
I overloaded it, so existing callers and subclasses should be fine. I also renamed them and added some documentation, maybe that's nicer now? |
There was a problem hiding this 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
Thanks @I-Al-Istannen |
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.