Jake Woods
06/29/2022, 7:01 AMKSType
? I’m doing the resolution with a hand-written algorithm right now and it feels wrongKSType
of Either<Nothing, Int>
and another of Either<Throwable, Nothing>
, I want to infer that their common ancestor is Either<Throwable, Int>
Jiaxiang
06/29/2022, 8:43 PMEither<out T, out P>
declared. Even after that, you still need to manually write a least common ancestor algorithm to determine the common ancestor you are looking for, and you also need to deal it with recursively as the type arguments can still be generics.Jake Woods
06/29/2022, 11:31 PMEither<out E, out T>
so I think the ancestor exists. I guess I was hoping KSP already had a least common ancestor implementation but it sounds like I'll need to roll my own 🙂Jiaxiang
06/29/2022, 11:32 PM