Nir
01/15/2021, 4:32 PMelse
or other control flow, as above, then I'd like to be able to write:
something {
...
}
my_else {
...
}
but this will never compile, you need to put the my_else
after the brace. Does it seem reasonable at all that the compiler could consider allowing this to compile, specifically when you have an infix function starting a line like thatCasey Brooks
01/15/2021, 4:51 PMsomething { }
completes the statement, and it is sufficient on its own, and there’s no syntactic marker to indicate that the next line is related to it
However, the official convention is actually to put the “else” on the same line as the previous bracket. So the more “conventional” solution is probably to adopt } else {
so that } my_else {
doesn’t look so strange, rather than make the infix function able to stand on the next line. Or else just use .my_else { }
on the next line, which does give that syntactic marker of a continued statement
https://kotlinlang.org/docs/reference/coding-conventions.html#formatting-control-flow-statementsNir
01/15/2021, 5:02 PMNir
01/15/2021, 5:02 PM