From f10f364721e6bcbb64e9adb86feb859ed4006f17 Mon Sep 17 00:00:00 2001 From: Yann Simon Date: Thu, 4 Jul 2024 17:26:09 +0200 Subject: [PATCH] Issue #4631: Make Later covariant Same as https://github.com/typelevel/cats/pull/937 --- core/src/main/scala/cats/Eval.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/cats/Eval.scala b/core/src/main/scala/cats/Eval.scala index 7834248b3c..ceb6b87fad 100644 --- a/core/src/main/scala/cats/Eval.scala +++ b/core/src/main/scala/cats/Eval.scala @@ -157,7 +157,7 @@ final case class Now[A](value: A) extends Eval.Leaf[A] { * by the closure) will not be retained, and will be available for * garbage collection. */ -final class Later[A](f: () => A) extends Eval.Leaf[A] { +final class Later[+A](f: () => A) extends Eval.Leaf[A] { private[this] var thunk: () => A = f // The idea here is that `f` may have captured very large @@ -206,7 +206,7 @@ object Eval extends EvalInstances { * so calling .value does not trigger * any flatMaps or defers */ - sealed abstract class Leaf[A] extends Eval[A] + sealed abstract class Leaf[+A] extends Eval[A] /** * Construct an eager Eval[A] value (i.e. Now[A]).