Closed
Description
We're seeing some type inference issues in trying to compile ZIO against the latest version of Dotty that don't entirely make sense to me. See compilation errors here. It appears that two of the issues can be minimized to the following:
trait ZIO[-R, +E, +A] { self =>
final def +++[R1, B, E1 >: E](that: ZIO[R1, E1, B]): ZIO[Either[R, R1], E1, Either[A, B]] =
for {
e <- ZIO.environment[Either[R, R1]]
r <- e.fold(self.map(Left(_)) provide _, that.map(Right(_)) provide _)
} yield r
// Found: (Left[A, Any] | Right[Any, B])(r)
// Required: Either[A, B]
def flatMap[R1 <: R, E1 >: E, B](f: A => ZIO[R1, E1, B]): ZIO[R1, E1, B] = ???
def map[B](f: A => B): ZIO[R, E, B] = ???
def provide[R](R: R): ZIO[Any, E, A] = ???
}
object ZIO {
def environment[R]: ZIO[R, Nothing, R] = ???
}
The other two also relate to types being inferred as Any
and are here and here.
When you have the chance could you please advise whether there is an issue here or something we need to be doing differently? Thanks!
Copying @jdegoes.