Skip to content

Commit

Permalink
Make the value of the class private (#2614)
Browse files Browse the repository at this point in the history
* Make the value of the class private

* add MiMa exceptions

* Add binary compat test
  • Loading branch information
coltfred authored and kailuowang committed Nov 16, 2018
1 parent 19ab9a3 commit dabae03
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion binCompatTest/src/main/scala/catsBC/MimaExceptions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

}
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/either.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/syntax/nested.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit dabae03

Please sign in to comment.