presto-main/src/main/java/io/prestosql/operator/scalar/annotations/ParametricScalarImplementation.java/ParametricScalarImplementation/matches
class ParametricScalarImplementation:    private static boolean matches(List<FunctionArgumentDefinition> argumentDefinitions, List<ArgumentProperty> argumentProperties)
    {
        if (argumentDefinitions.size() != argumentProperties.size()) {
            return false;
        }
        for (int i = 0; i < argumentDefinitions.size(); i++) {
            boolean expectedNullable = argumentDefinitions.get(i).isNullable();
            ArgumentProperty actualArgumentProperty = argumentProperties.get(i);
            if (actualArgumentProperty.getArgumentType() == FUNCTION_TYPE) {
                // functions are never null
                if (expectedNullable) {
                    return false;
                }
            }
            else {
                NullConvention actualNullConvention = actualArgumentProperty.getNullConvention();
                // block and position can be nullable or not
                if (actualNullConvention != BLOCK_AND_POSITION) {
                    boolean actualNullable = actualNullConvention != RETURN_NULL_ON_NULL;
                    if (expectedNullable != actualNullable) {
                        return false;
                    }
                }
            }
        }
        return true;
    }