public XQExpression staticAnalysis(StaticContext statEnv) throws XQueryException {
if(!_analyzed) {
this._analyzed = true;
this._leftOperand = _leftOperand.staticAnalysis(statEnv);
this._rightOperand = _rightOperand.staticAnalysis(statEnv);
final Type ltype = _leftOperand.getType();
if(!TypeUtil.subtypeOf(ltype, _type)) {
throw new TypeError("Inferred type of left operand is invalid: "
+ _leftOperand.getType());
}
final Type rtype = _rightOperand.getType();
if(!TypeUtil.subtypeOf(rtype, _type)) {
throw new TypeError("Inferred type of left operand is invalid: "
+ _rightOperand.getType());
}
this._type = TypeUtil.union(ltype, rtype);