union method

Set union(
  1. Set other
)

Implementation

Set union(Set other) {
  if (other is _CompleteSet) {
    return _CompleteSet();
  }

  if (other is _EmptySet) {
    return this;
  }

  return Set([...elements.keys, ...other.elements.keys]);
}