Skip to content

Add then to if statements using new control syntax #9701

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
Sep 2, 2020

Conversation

kpbochenek
Copy link
Contributor

Hi,

I am working on scalameta parser and trying to reach a stage where we can finally parse whole dotty codebase and enable continuous integration, I am unsure if this syntax if condition <indented block> without then is supported but it is very hard to parse right now.

  • as adding then doesn't change anything this should make no difference for you, correct?
  • is this syntax officially supported or an artifact of previous experiments?

Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Have an awesome day! ☀️

Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The then should definitely be added. I was on the fence for a while whether we want to support it it the end find it is better not to. A possible exception (for now) is if the condition is in parentheses, i.e. old syntax. Then we still support indentation in order not to entangle if-then-else syntax style with optional braces. But that's not completely settled either.

@nicolasstucki nicolasstucki merged commit de273a2 into scala:master Sep 2, 2020
@kpbochenek kpbochenek deleted the fix-syntax-minor branch September 2, 2020 15:25
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
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.

5 participants