Skip to content
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

Make indentation significant in old-style control syntax #7235

Merged
merged 8 commits into from
Sep 17, 2019

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 16, 2019

Indentation was significant only after new-style if-then, while-do, for-yield, for-do.
This was prone to cause gotchas. We now treat indentation as significant also if the
conditions or enumerators of these constructs use parens or braces.

Also: Introduce option to treat colon at eol as indentation start

A : at the end of a line starting an indentation region is now
allowed only if option -Yindent-colons is set. Rewriting to colons
is also subject to that setting.

@smarter smarter self-assigned this Sep 17, 2019
Indentation was significant only after new-style if-then, while-do, for-yield, for-do.
This was prone to cause gotchas. We now treat indentation as significant also if the
conditions or enumerators of these constructs use parens or braces.
Also: align indentation in some code
A `:` at the end of a line starting an indentation region is now
allowed only if option `-Yindent-colon` is set. Rewriting to colons
is also subject to that setting.
Previous edits already used new syntax. Rewriting to old syntax
was done automatically.
Drop it since it is not longer supported without a special option
@smarter smarter merged commit 8dbd8d4 into scala:master Sep 17, 2019
@smarter smarter deleted the generalize-indent branch September 17, 2019 13:45
@anatoliykmetyuk anatoliykmetyuk added this to the 0.19 Tech Preview milestone Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants