TInstance leftInstance = left.resultType();
TInstance rightInstance = right.resultType();
TClass tClass = leftInstance.typeClass();
assert tClass.compatibleForCompare(rightInstance.typeClass())
: tClass + " != " + rightInstance.typeClass();
if (tClass.underlyingType() != UnderlyingType.STRING)
return null;
CharacterTypeAttributes leftAttributes = StringAttribute.characterTypeAttributes(leftInstance);
CharacterTypeAttributes rightAttributes = StringAttribute.characterTypeAttributes(rightInstance);
return TString.mergeAkCollators(leftAttributes, rightAttributes);
}