-
Notifications
You must be signed in to change notification settings - Fork 87
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
Rewrite rule for Map#mapValues should call .view #216
Comments
This involves the same code but requesting that we have a way to update the code to remove the deprecation and still compile against 2.11 and 2.12.
The code in question: val aMapValue = Map("a" -> 1, "b" -> 2, "c" -> 3)
.mapValues(intValue(_): AbstractConfigValue)
.toMap |
It's also probably worth pointing out that |
@joshlemer yes, but that's a less straightforward rewrite, due to having to rewrite the function too |
I only had that in the code base 3 places so it certainly is an easy workaround for me.
I would never thought of it though. |
This fixes the following warning generated when tapir is being used with Scala 2.13: ``` method mapValues in trait MapOps is deprecated (since 2.13.0): Use .view.mapValues(f). A future version will include a strict version of this method (for now, .view.mapValues(f).toMap) ``` I am using tapir in my project with warnings-as-errors enabled. This warning prevents me from using `.in(formBody[...])` with case classes. The idea to switch to `transform` which is compatible with Scala 2.11, 2.12 and 2.13 was originally found here: scala/scala-collection-compat#216 (comment)
Rewrite rule for
Map#mapValues
should call.view
before calling.mapValues
(H/T @joshlemer)The text was updated successfully, but these errors were encountered: