phldavies
06/18/2024, 2:10 PMfunction-expression-body
to have detected the following:
fun foo(): Any {
return bar { return@bar null }
}
as it could be written as
fun foo(): Any = bar { return@bar null }
?Paul Dingemans
06/18/2024, 3:32 PMreturn
keyword twice in the body of the function. The rule does not apply when it founds that keyword more than once in the body.
block
.takeIf { it.containingOnly(RETURN) }
?.takeUnless { it.countReturnKeywords() > 1 }
I cannot recall why I added that last line. When I remove it, no unit tests breaks... Please create an issue for it and I will have a look at a later time.