Skip to content

Fix #10080: Allow end marker immediately after : at eol #10095

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
Oct 28, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Oct 27, 2020

No description provided.

Copy link
Contributor

@julienrf julienrf left a comment

Choose a reason for hiding this comment

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

I have a concern about the second part of the test. That being said, I’m not sure this is a huge issue.

end Foo

trait Bar
end Bar
Copy link
Contributor

Choose a reason for hiding this comment

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

This one looks confusing to me because I read trait Bar as a complete definition, so there is nothing to end. As I’ve mentioned in the linked issue, to me the “brace-significant” equivalent would be:

trait Bar
}

So, I’m not sure we should support it.

Also, it suggests that we could insert definitions between trait Bar and end Bar, like so:

trait Bar
  def quux: Quux
end Bar

But this would be rejected, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that one would be rejected.

@bishabosha
Copy link
Member

if do the following:

package foo

class B:
  // def foo = 23
  end B

I only get a warning that end B is too far to the right, but if I uncomment def foo = 23 then I get the error about misaligned end

@odersky
Copy link
Contributor Author

odersky commented Oct 28, 2020

I'd like to leave it at that. I am not ready to invest more time in this. If someone has another solution go ahead. Otherwise let's merge this or do nothing at all.

@bishabosha bishabosha merged commit 4bb1004 into scala:master Oct 28, 2020
@bishabosha bishabosha deleted the fix-#100080 branch October 28, 2020 11:27
@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.

4 participants