-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[java] Allow lambdas with unresolved target types to succeed inference #5339
Conversation
This prevents failures in code that uses lambdas
Generated by 🚫 Danger |
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.
Thanks!
private void foo(int y, FunctionalItf x) { | ||
} | ||
private void foo(FunctionalItf x) { | ||
return SummaryDto.ItemDto.builder().build(); |
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'll remove this return, as foo
is void.
return SummaryDto.ItemDto.builder().build(); | ||
} | ||
private <T extends FunctionalItf> T bar(T x) { | ||
return SummaryDto.ItemDto.builder().build(); |
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'll just do return x;
here to avoid bringing SummaryDto etc. into context (which are also unresolved).
This prevents failures in code that uses lambdas but doesn't have a full classpath. In particular, UnusedPrivateMethod used to report failures in this case.
Describe the PR
Related issues
Ready?
./mvnw clean verify
passes (checked automatically by github actions)