Skip to content

Rewrite immutable.Set/Map.+ #53

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 2 commits into from
Jun 22, 2018
Merged

Conversation

MasseGuillaume
Copy link
Contributor

The + operation no longer has an overload accepting multiple values

motivation:
https://github.com/scala/collection-strawman/wiki/FAQ#what-are-the-breaking-changes

2nd row, breaking change

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.

Awesome @MasseGuillaume! Do you mind adding some more test cases like the following?

(set + (2, 3)).map(x => x)
set + (2, 3) - 4

Do you see other possible corner cases?

op,
Nil,
List(rhs2)
).toString
Copy link
Contributor

Choose a reason for hiding this comment

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

What does toString do? That looks suspect 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's fine, it will drop any comments. It's the scope of https://github.com/scalacenter/scala-syntax

Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering whether toString was the recommended way to produce scala source code from a tree or if there was a method with a more meaningful name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I create the structure I want, then I pretty print. I dont want to deal with parenthesis.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I think it’s .syntax, 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.

exactly, I can use .syntax.

@MasseGuillaume
Copy link
Contributor Author

@julienrf I don't see any corner case. .syntax takes care of everything. I added a test + fix for (set + (2, 3)).map(x => x) it was removing the () from the lhs. Nice catch!

@julienrf julienrf merged commit 0ebd48d into scala:master Jun 22, 2018
@julienrf
Copy link
Contributor

Thanks!

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.

2 participants