We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
function-expression-body
Given code below:
fun foo(): Any { return if (true) { Foo() } else { return Bar() } }
this is formatted by Ktlint 1.0.0 (with experimental enabled) to:
fun foo(): Any = if (true) { Foo() } else { return Bar() }
and results in a compilation error as a body expression may not contain a return statement
The text was updated successfully, but these errors were encountered:
Do not replace function body having a return statement only in case t…
a89c78d
…he return statement contains an intermediate exit point Closes #2269
Do not replace function body with multiple exit points (#2273)
e2a6cd2
* Do not replace function body having a return statement only in case the return statement contains an intermediate exit point Closes #2269
Successfully merging a pull request may close this issue.
Given code below:
this is formatted by Ktlint 1.0.0 (with experimental enabled) to:
and results in a compilation error as a body expression may not contain a return statement
The text was updated successfully, but these errors were encountered: