Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions core/shared/src/main/scala/zio/Fiber.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import zio.internal.WeakConcurrentBag
* } yield (a, b)
* }}}
*/
abstract class Fiber[+E, +A] { self =>
sealed abstract class Fiber[+E, +A] { self =>

/**
* Same as `zip` but discards the output of the left hand side.
Expand Down Expand Up @@ -742,11 +742,11 @@ object Fiber extends FiberPlatformSpecific {
}

sealed trait Status { self =>
def isDone: Boolean = self match { case Status.Done => true; case _ => false }
def isDone: Boolean = self eq Status.Done

def isRunning: Boolean = self match { case _: Status.Running => true; case _ => false }
def isRunning: Boolean = self.isInstanceOf[Status.Running]

def isSuspended: Boolean = self match { case _: Status.Suspended => true; case _ => false }
def isSuspended: Boolean = self.isInstanceOf[Status.Suspended]
}
object Status {
sealed trait Unfinished extends Status {
Expand All @@ -763,7 +763,7 @@ object Fiber extends FiberPlatformSpecific {
final case class Running(runtimeFlags: RuntimeFlags, trace: Trace) extends Unfinished {
override def toString(): String = {
val currentLocation =
if (trace == Trace.empty) "<trace unavailable>"
if ((trace eq Trace.empty) || (trace eq null)) "<trace unavailable>"
else trace

s"Running(${RuntimeFlags.render(runtimeFlags)}, ${currentLocation})"
Expand All @@ -776,7 +776,7 @@ object Fiber extends FiberPlatformSpecific {
) extends Unfinished {
override def toString(): String = {
val currentLocation =
if (trace == Trace.empty) "<trace unavailable>"
if ((trace eq Trace.empty) || (trace eq null)) "<trace unavailable>"
else trace

s"Suspended(${RuntimeFlags.render(runtimeFlags)}, ${currentLocation}, ${blockingOn})"
Expand Down
Loading