#odersky-programming-in-scala-2ed #p109 #scala

In short, a line ending is treated as a semicolon unless one of the following conditions is true:
  1. The line in question ends in a word that would not be legal as the end of a statement, such as a period or an infix operator.
  2. The next line begins with a word that cannot start a statement.
  3. The line ends while inside parentheses (...) or brackets [...], because these cannot contain multiple statements anyway.


Discussion

Do you want to join discussion? Click here to log in or create user.