dartz icon indicating copy to clipboard operation
dartz copied to clipboard

How to cast both sides of Either?

Open jalvespinto opened this issue 2 years ago • 1 comments

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

jalvespinto avatar Dec 17 '22 20:12 jalvespinto