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

The mutable collection's factory method 'empty[T]' should have parenthesis #11096

Closed
kmizu opened this issue Aug 21, 2018 · 1 comment
Closed

Comments

@kmizu
Copy link

kmizu commented Aug 21, 2018

For example, an instance of scala.collection.mutable.Buffer can be created via:

val buffer = scala.collection.mutable.Buffer.empty[Int]

Since this method returns a different buffer for each call, it has side effect. Then, this method should be called as the followings:

val buffer = scala.collection.mutable.Buffer.empty[Int]()

However, since empty[T] method is declared as 'no parentheses' method, it cannot be done. I think it should be fixed. How do you think about it?

@SethTisue SethTisue added this to the 2.13.0-RC1 milestone Aug 21, 2018
@lrytz
Copy link
Member

lrytz commented Aug 21, 2018

We discussed this at scala/collection-strawman#520. Please re-open if you think that it needs further discussion.

@lrytz lrytz closed this as completed Aug 21, 2018
@SethTisue SethTisue removed this from the 2.13.0-RC1 milestone Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants