meet method

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

Meet operation (⊓): greatest lower bound of two abstract values.

Implementation

@override
NullabilityDomain meet(NullabilityDomain other) {
  if (isBottom || other.isBottom) return bottomValue;

  if (state == other.state) return this;
  if (state == Nullability.maybeNull) return other;
  if (other.state == Nullability.maybeNull) return this;

  // definitelyNull meet definitelyNonNull = bottom
  return bottomValue;
}