-
-
Notifications
You must be signed in to change notification settings - Fork 755
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
CanBeNonNullable false-negative #4492
Comments
Isn't #4431 supposed to catch this actually? |
Yes, but it is not. |
Hi! |
Please go ahead :) |
Should
|
Never though of someone writing something like that. But if it's not too difficult to control that case I don't see why not. |
I'm just looking through the tests for the rule and there are such cases |
Expected Behavior
assignedExpression
violatesCanBeNonNullable
.Observed Behavior
detekt is fine with that code
Context
If a function returns
Unit
any null check to exit the function if the parameter isnull
should be consider as a parameter that could be non-null.I saw this false-negative while working on this PR: #4491
Your Environment
The text was updated successfully, but these errors were encountered: