DfType (@NotNull DfType other) { if (other instanceof DfGenericObjectType || other instanceof DfEphemeralReferenceType) { return other.join(this); } if (isSuperType(other)) return this; if (other.isSuperType(this)) return other; if (!(other instanceof DfReferenceType type)) return TOP; TypeConstraint constraint = getConstraint().join(type.getConstraint()); DfaNullability nullability = getNullability().unite(type.getNullability()); Mutability mutability = getMutability().join(type.getMutability()); boolean locality = isLocal() && type.isLocal(); SpecialField sf = Objects.equals(getSpecialField(), type.getSpecialField()) ? getSpecialField() : null; DfType sfType = sf == null ? BOTTOM : getSpecialFieldType().join(type.getSpecialFieldType()); if (constraint.isSingleton() && nullability == DfaNullability.NOT_NULL) { return new DfReferenceConstantType(constraint, constraint, false); } return new DfGenericObjectType(Set.of(), constraint, nullability, mutability, sf, sfType, locality); }