-
Notifications
You must be signed in to change notification settings - Fork 635
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
val - Inferred Type is Object #260
Comments
Can you please test it with Lombok Plugin 0.12 ? |
UpdatedI've updated to the latest Lombok version (0.12) and tried Another ExampleHere is another example where it complains I'm returning val aggsTransform = transform(aggs.getBuckets(), bucket -> bucket.getKeyAsText().toString());
return aggsTransform; You can see the editor appears to be in a disagreement with itself: An interesting thing is if I cast it like so, it fixes the isssue with a redundant cast warning: val aggsTransform = (List<String>) transform(...); However if I cast it at the return, it seems to be complain about Extra RemarksI've tried with Our code base makes heavy use of streams, lambdas, and method references which seems to correlate with where our Also this project is open source as well in case you were curious at pulling it down and debugging the plugin. I hope that helps. Thank you for your response! |
If this issue is the same with Lombok and Eclipse (outside of IntelliJ that is) - this is a problem with Lombok itself. This project is only to provide IntelliJ support for Lombok - not to implement new features in core dependency. There is a well-known issue with |
As for your sample:
Seems to not throw an error with 2016.2 , lombok plugin 0.12 and lombok dependency 1.16.10. |
Eclipse does not have this issue. This is IntelliJ + lombok-intellij-plugin issue only. I only mentioned that it occurs in IntelliJ regardless of which compiler you are using. That particular issue you mentioned with lombok occurs only inside of lambda bodies and causes an actual compile error. All of our stuff builds fine with javac. You can find our source code here, and it is a maven project: https://github.com/icgc-dcc/dcc-portal |
Thanks for clarification. As long as the code compiles via command-line with |
I've just checked your project and it works as intended for me. Is there a specific file that is causing issues that I can check out? |
Interesting! Thanks for giving it a go. FileService does provide a single lombok val inference error for me. If the project looks misconfigured, it is because it was developed in Eclipse with Eclipse project files, and the project itself is a spring-boot project so for the I am just now investigating using IntelliJ for development on this project as we feel the Lombok support is in a good place. What I am going to do: As a sanity check, I am going to install IntelliJ, Lombok, ...etc.. on a virgin system and see what happens. Another spot where I am receiving an error is here (subtype variable is resolving to Thanks a lot! I appreciate the help, and I'll let you know what I find on a fresh system. |
One last note, the |
Latest lombok plugin supports Please double check if all parts of newly imported code have Annotation Processing enabled. |
I've reproduced the issue, and in the same file you tried (FileService.java, line 292 in my case). Fresh System
Original System
Going to attempt a couple more sanity checks on my main dev machine (Mac). |
Also this may sound silly but I'm observing some non determinism in the |
Not sure if related to this, but I noticed that IntelliJ was reporting exceptions caused by lombok plugin:
|
Closed this issue as obsolete now after last changes in IntelliJ 2020.3.EAP Feel free to open new one. |
Here is a code snippet:
TYPE_ID_MAPPINGS
is aMap<String, String>
explicitly defined as such.MULTIPLE_SEARCH_TYPES
is aSet<String>
also explicitly defined.Compiles fine but IntelliJ is complaining that
result
is ajava.lang.object
and cannot be passed totoStringArray
as it expects ajava.util.Collection<java.lang.String>
.This is with IntelliJ 2016.2 and latest plugin version.
The text was updated successfully, but these errors were encountered: