I'm surprised this is necessary. The regular check: if (!lhsDataType.isComparableTo(rhsDataType)) should cover this. Why doesn't it?