Skip to content

Commit

Permalink
remove redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
not-napoleon committed Jan 31, 2024
1 parent a548242 commit f9b1629
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,7 @@ protected TypeResolution checkCompatibility() {
|| (leftType == UNSIGNED_LONG && (false == (rightType == UNSIGNED_LONG || rightType == DataTypes.NULL)))) {
return new TypeResolution(formatIncompatibleTypesMessage(symbol(), leftType, rightType));
}
// If the LHS is numeric, the RHS should be numeric or null
if (leftType.isNumeric()) {
if (false == (rightType.isNumeric() || DataTypes.isNull(rightType))) {
return new TypeResolution(formatIncompatibleTypesMessage(symbol(), leftType, rightType));
}
}

// at this point, left should be null, and right should be null or numeric.
return TypeResolution.TYPE_RESOLVED;
}
Expand Down

0 comments on commit f9b1629

Please sign in to comment.