kevinmost
09/15/2017, 3:34 PM+ on new lines as @gabrielfv suggested:
foo("one"
+ "two"
+ "three")
only to find that it doesn’t work with return, e.g. the following doesn’t compile because of + on new line:
fun bar(): String {
return "one;"
+ "two;"
+ "three"
}
I’d argue this means that + and .plus() are already different enough to have different formatting 🙂 /cc @kevinmost
1 reply
I don't know that that necessarily means they should be formatted differently. The only reason that that doesn't work the way you expect is because it resolves as return "one" and +"two" (the unaryPlus operator)
So a new unary operator call should definitely not be further indented, but if you mean it to be a binary plus operator, you should definitely indent it to indicate that it's a continuation of what you started on the previous line