Skip to content

Fix #9790: Update indentation spec to match observed behavior #10331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/docs/reference/other-new-features/indentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ There are two rules:

- the first token on the next line has an indentation width strictly less
than the current indentation width, and
- the last token on the previous line is not one of the following tokens
which indicate that the previous statement continues:
```
then else do catch finally yield match
```
- the first token on the next line is not a
[leading infix operator](../changed-features/operators.html).

Expand Down
7 changes: 7 additions & 0 deletions tests/neg/i9790.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
object A:
def fn: Unit =
if true then
println(1)
println(2) // error: start of line does not match previous indentation widths
else
println(2)