for(int i = 0; i < arity; i++) {
Type expected = expectedTypes[i];
XQExpression expr = params.get(i);
Type actual = expr.getType();
if(!TypeUtil.subtypeOf(actual, expected)) {// REVIEWME ok
throw new TypeError("err:XPTY0004", i + "th parameter type '" + actual
+ "' does not match to the expected argument type '" + expected + '\'');
}
}
return this;
}