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

Either.value with some updates #1895

Merged
merged 5 commits into from
Oct 27, 2020
Merged

Conversation

bvenners
Copy link
Contributor

No description provided.

brendanmaguire and others added 5 commits August 22, 2020 19:47
* `Either.value` is right biased
* Allows users of Scala 2.13 to use `EitherValues` for `Right`s without getting deprecation warnings

Also correct param documentation for `Left` and `Right` conversions
@cla-bot
Copy link

cla-bot bot commented Sep 25, 2020

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Bill Venners.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@bvenners
Copy link
Contributor Author

@cheeseng can you check this with MIMA? Also I'd like to question the SerialVersionIds. Should we have those or would it be better to leave them off. For the time being I didn't add one for the new class I added (which I'm hoping won't break binary compatibility).

@cheeseng
Copy link
Contributor

cheeseng commented Oct 2, 2020

@bvenners I ran this through MIMA test, for scala 2.10 and 2.11 it fails with:

[error] scalatest-core: Failed binary compatibility check against org.scalatest:scalatest-core_2.10:3.2.2! Found 1 potential problems
[error]  * method convertEitherToValuable(scala.util.Either,org.scalactic.source.Position)org.scalatest.EitherValues#Valuable in trait org.scalatest.EitherValues is present only in current version
[error]    filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("org.scalatest.EitherValues.convertEitherToValuable")
[error] java.lang.RuntimeException: Failed binary compatibility check against org.scalatest:scalatest-core_2.10:3.2.2! Found 1 potential problems
[error]         at scala.sys.package$.error(package.scala:30)
[error]         at com.typesafe.tools.mima.plugin.SbtMima$.reportModuleErrors(SbtMima.scala:75)
[error]         at com.typesafe.tools.mima.plugin.MimaPlugin$.$anonfun$projectSettings$2(MimaPlugin.scala:38)
[error]         at com.typesafe.tools.mima.plugin.MimaPlugin$.$anonfun$projectSettings$2$adapted(MimaPlugin.scala:28)
[error]         at scala.collection.Iterator.foreach(Iterator.scala:941)
[error]         at scala.collection.Iterator.foreach$(Iterator.scala:941)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
[error]         at com.typesafe.tools.mima.plugin.MimaPlugin$.$anonfun$projectSettings$1(MimaPlugin.scala:28)
[error]         at com.typesafe.tools.mima.plugin.MimaPlugin$.$anonfun$projectSettings$1$adapted(MimaPlugin.scala:26)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error]         at sbt.Execute.work(Execute.scala:290)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] (scalatestCore / mimaReportBinaryIssues) Failed binary compatibility check against org.scalatest:scalatest-core_2.10:3.2.2! Found 1 potential problems
[error] Total time: 17 s, completed Oct 2, 2020 10:54:45 AM

which I think should be fine, do you concur? I'll submit a PR to ignore that error against your branch.

@cheeseng
Copy link
Contributor

cheeseng commented Oct 5, 2020

@bvenners I submitted the following PR for ignoring the related MIMA check:

#1901

@bvenners bvenners merged commit 48dda1e into 3.2.x-new Oct 27, 2020
*
* @param either the <code>Either</code> on which to add the <code>value</code> method
*/
implicit def convertEitherToValuable[L, R](either: Either[L, R])(implicit pos: source.Position): Valuable[L, R] = new Valuable(either, pos)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not to use implicit class instead of implicit conversion?

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.

4 participants