Dmitry Kandalov
09/15/2017, 10:08 AM+
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 @kevinmostgabrielfv
09/15/2017, 7:01 PMkevinmost
09/15/2017, 7:03 PM+
at the end of the previous line, not the start of the newline, for it to pick Foo.plus(Bar)
over unaryPlus(Bar)
gabrielfv
09/15/2017, 7:24 PM?.
scenario. Of course there's a good explanation.gabrielfv
09/15/2017, 7:26 PMunaryPlus()
, since unaryPlus(a) == a
?kevinmost
09/15/2017, 7:29 PMunaryMinus()
, since you'd certainly want to do -50
for example 😆kevinmost
09/15/2017, 7:30 PMdependencies {
+ "org.jetbrains.kotlin:kotlin-stdlib:1.1.4-2"
}
gabrielfv
09/15/2017, 8:34 PMreturn "one;"
is a closed statement, and so are the + "etc"
lines, that cannot be reached and break compilation.gabrielfv
09/15/2017, 8:34 PM