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? 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
Original
when (true) { true if when (true) { true -> true false -> false } -> true else -> false }
After formatting
when (true) { true if when (true) { true -> true false -> false }, -> true else -> false }
Which is illegal
The text was updated successfully, but these errors were encountered:
For now you can work around this as follows:
@Suppress("ktlint:standard:trailing-comma-on-declaration-site") when (true) { true if when (true) { true -> true false -> false } -> true else -> false }
Sorry, something went wrong.
The problem seems to occur only when the guard clause is a multiline expression.
Code below reproduces the error:
val x2 = when (true) { true if foo( "a", ) -> true else -> false }
while code below does not reproduce:
val x3 = when (true) { true if foo("a") -> true else -> false }
Do not insert a trailing comma in a multiline when-entry containing a…
51f3993
… guard Closes #2817
524ecb3
Successfully merging a pull request may close this issue.
Original
After formatting
Which is illegal
The text was updated successfully, but these errors were encountered: