diff --git a/core/src/main/scala/cats/data/EitherT.scala b/core/src/main/scala/cats/data/EitherT.scala index 13724cc88b..e473ff9ae0 100644 --- a/core/src/main/scala/cats/data/EitherT.scala +++ b/core/src/main/scala/cats/data/EitherT.scala @@ -1186,13 +1186,13 @@ private[data] trait EitherTSemigroupK[F[_], L] extends SemigroupK[EitherT[F, L, def combineK[A](x: EitherT[F, L, A], y: EitherT[F, L, A]): EitherT[F, L, A] = EitherT(F.flatMap(x.value) { case r @ Right(_) => F.pure(r) - case _ => y.value + case Left(_) => y.value }) override def combineKEval[A](x: EitherT[F, L, A], y: Eval[EitherT[F, L, A]]): Eval[EitherT[F, L, A]] = Eval.now(EitherT(F.flatMap(x.value) { case r @ Right(_) => F.pure(r: Either[L, A]) - case _ => y.value.value + case Left(_) => y.value.value })) } diff --git a/core/src/main/scala/cats/data/Ior.scala b/core/src/main/scala/cats/data/Ior.scala index ce6c0410fd..68379989a8 100644 --- a/core/src/main/scala/cats/data/Ior.scala +++ b/core/src/main/scala/cats/data/Ior.scala @@ -941,7 +941,7 @@ sealed abstract private[data] class IorInstances extends IorInstances0 { ff match { case Ior.Left(e2) => Ior.Left(E.combine(e2, e1)) case Ior.Both(e2, _) => Ior.Left(E.combine(e2, e1)) - case _ => Ior.Left(e1) + case Ior.Right(_) => Ior.Left(e1) } } } diff --git a/core/src/main/scala/cats/data/Validated.scala b/core/src/main/scala/cats/data/Validated.scala index 48a12f8356..f67ea8d799 100644 --- a/core/src/main/scala/cats/data/Validated.scala +++ b/core/src/main/scala/cats/data/Validated.scala @@ -908,8 +908,8 @@ sealed abstract private[data] class ValidatedInstances extends ValidatedInstance } case Valid(a) => fb match { - case Valid(b) => Valid(f(Ior.both(a, b))) - case _ => Valid(f(Ior.left(a))) + case Valid(b) => Valid(f(Ior.both(a, b))) + case Invalid(_) => Valid(f(Ior.left(a))) } } } diff --git a/core/src/main/scala/cats/instances/either.scala b/core/src/main/scala/cats/instances/either.scala index 6ad19ebb50..586abc48c8 100644 --- a/core/src/main/scala/cats/instances/either.scala +++ b/core/src/main/scala/cats/instances/either.scala @@ -201,12 +201,12 @@ trait EitherInstances extends cats.kernel.instances.EitherInstances { case Right(b) => fc match { case Right(c) => Right(f(Ior.both(b, c))) - case _ => Right(f(Ior.left(b))) + case Left(_) => Right(f(Ior.left(b))) } case left @ Left(_) => fc match { case Right(c) => Right(f(Ior.right(c))) - case _ => left.rightCast[D] + case Left(_) => left.rightCast[D] } }