Closed 987Nabil closed 6 months ago
Does it still infer A | B
if they are independent from each other, and not Any
?
Yes, it does. This is the same technique used by Either#merge
which works also well with Scala 3 union types.
I actually think this is the only right design to have inferred super types that might be union types.
@jdegoes I realised, that for
The current version would return
Schema[A | B]
forSchema[A].orElse(Schema[B])
but with this change it would returnSchema[Foo]
. Also the inline removes the need for class tags