-
Notifications
You must be signed in to change notification settings - Fork 91
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
PreferSetEmpty,etc. seem misleading #481
Comments
Actually I guess you probably mean that a |
Let's establish what's the truth first. And then I suggest we can adjust the message to reflect that. I am checking for Scala 2.12.11. If I am reading the code correctly:
Not sure if you agree with this reasoning. For
So without checking other versions my hunch is:
And the risk is that it's more sophisticated. Maybe the difference is even in the minor versions. |
@mccartney I don't disagree the about the creation of the intermediate object in some version. As my second comment on the issue indicates, the problem is that message could be clearer:
The way that sentence is worded makes me think a new empty |
The inspection currently states
Arguably the
apply()
method does not document this, butSet[T]()
does not allocate a new object in practice in any version of Scala I have tested. So it might be clearer to say that the documentation does not make this guarantee about future versions.The text was updated successfully, but these errors were encountered: