-
Notifications
You must be signed in to change notification settings - Fork 355
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
Incorrect type argument inference #5070
Comments
Thanks for reporting! I agree this shouldn't be an error. The problem isn't that the captures aren't comparable, but rather that the method type argument inferred for |
Yeah, I saw that ticket and thought they might be related, since the issue goes away once I explicitly specify the otherwise inferred type, but I wasn't sure. I hope you don't mind if I dump all/some of the issues that I encounter with CF here. Feel free to close them as duplicates if they are already tracked by some other ticket. It's sometimes difficult for me to figure out if some error reported by CF is a false-positive, if that matches the description of some existing ticket, or if it is actually an issue with my code. |
We appreciate bug reports even if they turn out to be duplicates! |
This test case was fixed with #979. |
I am using the Gradle plugin (v 0.6.8) to invoke the CheckerFramework (v 3.21.2).
Simplified reproduction example:
This compiles fine, but CF complains. CF error:
My expectation would have been that if the return type is
List<? extends String>
and I invoke some method that returns aList<? extends String>
(or any other kind of list with a element type that satisfies the declared lower and upper bounds), I should be able to forward the result of that. But CF considers those 2 lists incompatible because their element types involve different captures.Edit: With an explicitly specified type for the
Provider
lambda the error is gone:The text was updated successfully, but these errors were encountered: