Skip to content

Commit

Permalink
Merge pull request #3365 from djspiewak/bug/revert-deferred-specializ…
Browse files Browse the repository at this point in the history
…ation

Bypass `IO`-specialized `Deferred` for now
  • Loading branch information
djspiewak authored Jan 16, 2023
2 parents 95be999 + 54ce76e commit feff5f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/cats/effect/IO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ object IO extends IOCompanionPlatform with IOLowPriorityImplicits {

def ref[A](a: A): IO[Ref[IO, A]] = IO(Ref.unsafe(a))

def deferred[A]: IO[Deferred[IO, A]] = IO(new IODeferred[A])
def deferred[A]: IO[Deferred[IO, A]] = IO(Deferred.unsafe)

def bracketFull[A, B](acquire: Poll[IO] => IO[A])(use: A => IO[B])(
release: (A, OutcomeIO[B]) => IO[Unit]): IO[B] =
Expand Down
2 changes: 1 addition & 1 deletion tests/shared/src/test/scala/cats/effect/IOSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ class IOSpec extends BaseSpec with Discipline with IOPlatformSpecification {
}

"produce a specialized version of Deferred" in real {
IO.deferred[Unit].flatMap(d => IO(d must haveClass[IODeferred[_]]))
IO.deferred[Unit].flatMap(d => IO((d must haveClass[IODeferred[_]]).pendingUntilFixed))
}

platformSpecs
Expand Down

0 comments on commit feff5f6

Please sign in to comment.