Skip to content
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

Multiline if-else rule autocorrect can fail on if inside of function call params #1079

Closed
shashachu opened this issue Feb 12, 2021 · 0 comments · Fixed by #1082
Closed

Multiline if-else rule autocorrect can fail on if inside of function call params #1079

shashachu opened this issue Feb 12, 2021 · 0 comments · Fixed by #1082
Labels

Comments

@shashachu
Copy link
Contributor

shashachu commented Feb 12, 2021

Steps to Reproduce

Formatting this code

package foo.bar

fun main() {
    myFunction(
        if (foo) a else
            b,
        c
    )
}

results in

package foo.bar

fun main() {
    myFunction(
        if (foo) a else {
            b,
        }
        c
    )
}

which doesn't compile.

Your Environment

  • Version of ktlint used: 0.40.0
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): CLI
  • Version of Gradle used (if applicable): 6.6
  • Operating System and version: Mac OS 10.15.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant