Type Joins
Type join is an operation to help reduce the necessaity to create new types. It is a way to combine multiple types into a single type. Only interface datatypes can joined together. Resuting in a new type combining the methods of both. When comparing actual values with a type join, the values must have a data type that represents a class that implements all of the interfaces in the type join. A type join is declared using the & operator. Here is an example:
Nullables cannot be joined with interfaces. This is because nullables are not interfaces. They are a special type of data type. However, a join type can be nullable. Here is an example:
From a compiler perspective, joins are transformed into a single interface that groups all methods together, hence all rules that applies to interface, applies the the entire group of joins as well.