1

I am trying to have Either<Failure, Concrete> where Concrete extends Abstract class, but I cannot get it to work. If I try to cast the left side I get the error:

type 'Right<Failure, Concrete>' is not a subtype of type 'Either<Failure, Abstract>' in type cast

if I try for the right side I get:

type 'Left<Object, Concrete>' is not a subtype of type 'Either<Failure, Concrete>' in type cast

And bimap does not seems to solve it. Is there an easy way to do it? tks

Joaquim
  • 111
  • 1
  • 10
  • Please provide minimal but complete code that can reproduce the problem you're trying to describe. – jamesdlin Dec 17 '22 at 21:46
  • in fpdart, you can do that with Either.safeCast, just rolled out yesterday. And I strongly recommend you switch from dartz to fpdart. – Randal Schwartz Dec 18 '22 at 00:10

0 Answers0