- In the case of adding the result of an arbitrary expression E1 to an arbitrary expression E2 (E1 + E2), static type inference first determines the static types of E1 and E2 and then checks their static types with the allowed types for the operation. For example, if the static type of E1 can be either an **xs:string** or an **xs:integer**, the static type check raises a type error, even though some values at run time might be integers. The same would be the case if the static type of E1 were **xs:integer\***. Because the **+** operation only accepts exactly one integer value and E1 could return zero or more than 1, the static type check raises an error.
0 commit comments