From fc091a1ad721433a56e5c344e1317ae1e0393fba Mon Sep 17 00:00:00 2001 From: Colt Frederickson Date: Thu, 15 Nov 2018 11:35:00 -0700 Subject: [PATCH 1/3] Make the value of the class private --- core/src/main/scala/cats/syntax/either.scala | 2 +- core/src/main/scala/cats/syntax/nested.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/cats/syntax/either.scala b/core/src/main/scala/cats/syntax/either.scala index 8fa82ca1d7..916db248bb 100644 --- a/core/src/main/scala/cats/syntax/either.scala +++ b/core/src/main/scala/cats/syntax/either.scala @@ -404,7 +404,7 @@ trait EitherSyntaxBinCompat0 { new EitherIdOpsBinCompat0(a) } -final class EitherIdOpsBinCompat0[A](val value: A) extends AnyVal { +final class EitherIdOpsBinCompat0[A](private val value: A) extends AnyVal { /** * Wrap a value to a left EitherNec diff --git a/core/src/main/scala/cats/syntax/nested.scala b/core/src/main/scala/cats/syntax/nested.scala index 16a96a4da1..9db2163d80 100644 --- a/core/src/main/scala/cats/syntax/nested.scala +++ b/core/src/main/scala/cats/syntax/nested.scala @@ -8,7 +8,7 @@ trait NestedSyntax { new NestedIdOps[F, G, A](value) } -final class NestedIdOps[F[_], G[_], A](private[syntax] val value: F[G[A]]) extends AnyVal { +final class NestedIdOps[F[_], G[_], A](private val value: F[G[A]]) extends AnyVal { /** * Wrap a value in `Nested`. From a1b2c14f26191d33f69cecdd41e1f3de14b217ee Mon Sep 17 00:00:00 2001 From: Colt Frederickson Date: Thu, 15 Nov 2018 11:50:22 -0700 Subject: [PATCH 2/3] add MiMa exceptions --- build.sbt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 69122d431a..6adf2f4fb9 100644 --- a/build.sbt +++ b/build.sbt @@ -280,7 +280,10 @@ def mimaSettings(moduleName: String) = exclude[DirectMissingMethodProblem]("cats.data.KleisliInstances1.catsDataCommutativeArrowForKleisli"), exclude[DirectMissingMethodProblem]("cats.data.KleisliInstances4.catsDataCommutativeFlatMapForKleisli"), exclude[DirectMissingMethodProblem]("cats.data.IRWSTInstances1.catsDataStrongForIRWST"), - exclude[DirectMissingMethodProblem]("cats.data.OptionTInstances1.catsDataMonadErrorMonadForOptionT") + exclude[DirectMissingMethodProblem]("cats.data.OptionTInstances1.catsDataMonadErrorMonadForOptionT"), + //These 2 things are `.value` on a Ops class (which shouldn't have ever been exposed) - See #2514 and #2613. + exclude[DirectMissingMethodProblem]("cats.syntax.EitherIdOpsBinCompat0.value"), + exclude[DirectMissingMethodProblem]("cats.syntax.NestedIdOps.value") ) ++ // Only compile-time abstractions (macros) allowed here Seq( exclude[IncompatibleMethTypeProblem]("cats.arrow.FunctionKMacros.lift"), From e3df75035bf5783d68ee17f14a82c50639676a6f Mon Sep 17 00:00:00 2001 From: Colt Frederickson Date: Thu, 15 Nov 2018 14:07:32 -0700 Subject: [PATCH 3/3] Add binary compat test --- binCompatTest/src/main/scala/catsBC/MimaExceptions.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/binCompatTest/src/main/scala/catsBC/MimaExceptions.scala b/binCompatTest/src/main/scala/catsBC/MimaExceptions.scala index 8beaa353be..8e8473fd7d 100644 --- a/binCompatTest/src/main/scala/catsBC/MimaExceptions.scala +++ b/binCompatTest/src/main/scala/catsBC/MimaExceptions.scala @@ -18,7 +18,9 @@ object MimaExceptions { cats.data.Kleisli.catsDataCommutativeFlatMapForKleisli[Option, Int], cats.data.IRWST.catsDataStrongForIRWST[List, Int, Int, Int], cats.data.OptionT.catsDataMonadErrorMonadForOptionT[List], - FunctionK.lift(headOption) + FunctionK.lift(headOption), + "blah".leftNec[Int], + List(Some(4), None).nested ) }