Skip to content

mutable.MultiMap cannot be used as documented without warnings #11504

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

Closed
raboof opened this issue Apr 26, 2019 · 6 comments · Fixed by scala/scala#8005
Closed

mutable.MultiMap cannot be used as documented without warnings #11504

raboof opened this issue Apr 26, 2019 · 6 comments · Fixed by scala/scala#8005

Comments

@raboof
Copy link

raboof commented Apr 26, 2019

The mutable.MultiMap docs suggest val mm = new HashMap[Int, Set[String]] with MultiMap[Int, String], but HashMap is marked @deprecatedInheritance("HashMap wil be made final; use .withDefault for the common use case of computing a default value", "2.13.0").

@lrytz
Copy link
Member

lrytz commented Apr 26, 2019

Should MultiMap be deprecated? @szeiger / @julienrf

@lrytz lrytz added this to the 2.13.0-RC2 milestone Apr 26, 2019
@julienrf
Copy link

Probably, but we should provide a proper replacement.

@lrytz
Copy link
Member

lrytz commented Apr 26, 2019

Would it be enought to point people to scala-collection-contrib? Is it planned to release that module?

@julienrf
Copy link

We need to make this repository “releasable”, and then to find someone who wants to take the responsibility of pushing git tags to cut releases.

@szeiger
Copy link

szeiger commented Apr 26, 2019

We could provide a factory method that gives you a MultiMap for a HashMap typed as Map with MultiMap. It could still be implemented as a wrapper (similar to MultiDict) when HashMap is made final.

But I would prefer to deprecate MultiMap instead. I'm not sure we should point to MultiDict as a recommended replacement at this point. After all, if we were sufficiently confident that the API is good and can be kept stable we should have added it to the standard library. We could recommend a simple Map as a replacement (and point to MultiDict as another option). After all, MultiMap does not add much functionality on top of Map.

@szeiger
Copy link

szeiger commented May 2, 2019

The PR targets 2.13.1. Since deprecation is the most likely solution (and the current implementation works fine, albeit with a deprecation warning) I'm rescheduling this to 2.13.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants