join method

  1. @override
NullabilityDomain join(
  1. NullabilityDomain other
)
override

Join operation (⊔): least upper bound of two abstract values.

Implementation

@override
NullabilityDomain join(NullabilityDomain other) {
  if (isBottom) return other;
  if (other.isBottom) return this;

  // Join lattice:
  //       maybeNull (top)
  //      /          \
  // definitelyNull  definitelyNonNull
  //      \          /
  //        bottom
  if (state == other.state) return this;
  return topValue; // Different non-bottom states join to top
}