diff options
Diffstat (limited to 'core/src/mill/eval/Result.scala')
-rw-r--r-- | core/src/mill/eval/Result.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/src/mill/eval/Result.scala b/core/src/mill/eval/Result.scala index 690c5d30..d0400599 100644 --- a/core/src/mill/eval/Result.scala +++ b/core/src/mill/eval/Result.scala @@ -2,14 +2,16 @@ package mill.eval sealed trait Result[+T]{ def map[V](f: T => V): Result[V] + def asSuccess: Option[Result.Success[T]] = None } object Result{ implicit def create[T](t: => T): Result[T] = { try Success(t) catch { case e: Throwable => Exception(e, new OuterStack(new java.lang.Exception().getStackTrace)) } } - case class Success[T](value: T) extends Result[T]{ + case class Success[+T](value: T) extends Result[T]{ def map[V](f: T => V) = Result.Success(f(value)) + override def asSuccess = Some(this) } case object Skipped extends Result[Nothing]{ def map[V](f: Nothing => V) = this |