diff --git a/core/shared/src/main/scala/cats/effect/IO.scala b/core/shared/src/main/scala/cats/effect/IO.scala index 43a9b3915d..b1785dd1c8 100644 --- a/core/shared/src/main/scala/cats/effect/IO.scala +++ b/core/shared/src/main/scala/cats/effect/IO.scala @@ -802,6 +802,11 @@ sealed abstract class IO[+A] private () extends IOPlatform[A] { def void: IO[Unit] = map(_ => ()) + def voidError(implicit ev: A <:< Unit): IO[Unit] = { + val _ = ev + asInstanceOf[IO[Unit]].handleError(_ => ()) + } + /** * Converts the source `IO` into any `F` type that implements the [[LiftIO]] type class. */