We have released another video on Scala3 series which talks about a new type i.e. Union Types.
Union Type is a type which is one of a set of other type, or a type of a variable or expression which can consist of multiple types. And the main reason for introducing Union Types in Scala is that for every set of types, we can always form a finite LUB.
A Type A | B | C is a Union Type which has all the values of type A, type B and type C.
Union Types are commutative by nature. This means that A | B is same type as B | A.
Watch out the video to get more details on it.