UNION

This operator expects an input that is a subtype of all other inputs. It returns a concatenation of these inputs.

This page discusses:

See Also
Expression Language
Defining and Managing Data Queries

Input

N subtypes of E elements.

Output

A subtype of E elements, which is the common subtype of all inputs.

Important: Unlike the mathematical Union, duplicates are not removed. The union operator does not keep the order of the input elements: the output order is unspecified.

Example

If you have 2 classes:

  • class B {}
  • class A : B {}

... as Item<B> is a subclass of Item<A>, you can make a union that returns Item<B>.

For example:

  • The union between Person and Company does not work, because Person is not a subtype of Company, and Company is not a subtype of Person.

  • The union between core.Item and Person works fine, as core.Item is a subtype of Person.