public function __toString() : string
{
// Create a new array containing the string
// representations of each type
$type_name_list = array_map(function (Type $type) : string {
return (string) $type;
}, $this->getTypeSet()->toArray());
// Sort the types so that we get a stable
// representation
asort($type_name_list);
// Join them with a pipe
return implode('|', $type_name_list);
}