I have this code:
(for {
oldResult <- EitherT[Future, A, B](getById(id))
newResult <- EitherT.right(update(changeOldData(oldResult)))
} yield newResult).value
Where the functions returns
getById -> Future[Either[A, B]]
update -> Future[B]
changeOldData -> B
The entire block is suppose to return:
Future[Either[A, B]]
In IntelliJ, there is no complains about the code above, but when compiling, I'm getting the following error:
[error] found : B => cats.data.EitherT[scala.concurrent.Future,Nothing,B]
[error] required: B => cats.data.EitherT[scala.concurrent.Future,A,B]
[error] oldResult <- EitherT[Future, A, B](
I tried to not include the type and I'm getting the same error as well. Any idea why?