[fix](array-type) Fix incorrect in function-set for array type (#11585)

There is some wrong logic in FunctionSet.java and it may causes potential risks for array functions invoke.
This commit is contained in:
xy720
2022-08-15 21:29:57 +08:00
committed by GitHub
parent 71df82696d
commit fef37990a3
2 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ public class ArrayType extends Type {
return false;
}
ArrayType otherArrayType = (ArrayType) other;
return otherArrayType.itemType.equals(itemType);
return otherArrayType.itemType.equals(itemType) && otherArrayType.containsNull == containsNull;
}
public static boolean canCastTo(ArrayType type, ArrayType targetType) {

View File

@ -1200,7 +1200,7 @@ public class FunctionSet<T> {
if (!(descArgTypes[0] instanceof ScalarType)
|| !(candicateArgTypes[0] instanceof ScalarType)) {
if (candicateArgTypes[0] instanceof ArrayType) {
return candicateArgTypes[0].matchesType(descArgTypes[0]);
return descArgTypes[0].matchesType(candicateArgTypes[0]);
}
return false;