-
-
Notifications
You must be signed in to change notification settings - Fork 797
False positive: UseCheckOrError #2514
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
Okay. Have you tried to rewrite the lambda to something like this? val lambda: (Throwable) -> Unit = {
check(it is IllegalStateException) { throw IllegalStateException(it) } // or just { it }
println("something")
} |
My snipped was just a simplification. The point is that |
@BraisGabin mine was also about simplification. The whole rule is about simplification. You could use either |
The code is something like this but with domain exceptions (users not logged, user disabled, user no verfied...). |
The basic rule part could check for a string literal argument. |
Now I see the issue. |
Expected Behavior
This code should not be flagged
Observed Behavior
It is flagged
Context
Replacing
throw IllegalStateException(error)
witherror(error)
changes the behaviour so it should not be flagged.Your Environment
The text was updated successfully, but these errors were encountered: