-
Notifications
You must be signed in to change notification settings - Fork 1.7k
unnecessary_lambdas
false positive when affecting inference
#58986
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
Comments
The The problem is that the conditional expression produces a value whose static type is the least upper bound of the types of the
But there is a bug here, in that |
argument_type_not_assignable
false positiveunnecessary_lambdas
false positive
unnecessary_lambdas
false positiveunnecessary_lambdas
false positive
Understood. Though I still don't follow why the |
You're right, the type of the parameter is inferred to be |
Thank you for the explanation! |
Yes. Thank you both! |
unnecessary_lambdas
false positiveunnecessary_lambdas
false positive when affecting inference
@bwilkerson, is there any documentation on this? I want to understand better, why it couldn't interfere |
This comment in the language tracker may be your best source of documentation, and the current state of things. |
Describe the issue
I had a tear-off on my parameter, but I had to change it with a ternary operator. That triggered this false positive.
To Reproduce
argument_type_not_assignable
triggering on:When I "solved" that with:
Previously I had (and it was working):
Expected behavior
argument_type_not_assignable
not triggering when that solvesunnecessary_lambdas
or stoppingunnecessary_lambdas
from triggering.The text was updated successfully, but these errors were encountered: