Why no line break before `+` but before `.` in Kotlin?

Viewed 62

I am trying to understand this answer: https://stackoverflow.com/a/44180583/481061 and particularly this part:

if the first line of the statement is a valid statement, it won't work:

val text = "This " + "is " + "a "
         + "long " + "long " + "line" // syntax error

This does not seem to be the case for the dot operator:

val text = obj
           .getString()

How does this work? I'm looking at the grammar (https://kotlinlang.org/docs/reference/grammar.html) but am not sure what to look for to understand the difference. Is it built into the language outside of the grammar rules, or is it a grammar rule?

1 Answers
Related