You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/reference/other-new-features/indentation.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,8 @@ or
69
69
Colons at the end of lines are their own token, distinct from normal `:`.
70
70
The Scala grammar is changed so that colons at end of lines are accepted at all points
71
71
where an opening brace is legal, except if the previous token can already start an
72
-
indentation region.
72
+
indentation region. Special provisions are taken so that method result types can still use a colon on
73
+
the end of a line, followed by the actual type on the next.
73
74
74
75
### Special Treatment of Case Clauses
75
76
@@ -93,7 +94,6 @@ case 5 => print("V")
93
94
println(".")
94
95
```
95
96
96
-
97
97
### The End Marker
98
98
99
99
Indentation-based syntax has many advantages over other conventions. But one possible problem is that it makes it hard to discern when a large indentation region ends, since there is no specific token that delineates the end. Braces are not much better since a brace by itself also contains no information about what region is closed.
@@ -148,14 +148,16 @@ enum IndentWidth:
148
148
def< (that: IndentWidth):Boolean=this<= that &&!(that <=this)
0 commit comments