Skip to content

Commit

Permalink
Issue #4631: Make Later covariant
Browse files Browse the repository at this point in the history
Same as #937
  • Loading branch information
yanns committed Jul 4, 2024
1 parent 824b1cb commit f10f364
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/Eval.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]).
Expand Down

0 comments on commit f10f364

Please sign in to comment.