Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 600ccee

Browse files
authored
Update xquery-and-static-typing.md
1 parent c517491 commit 600ccee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/xquery/xquery-and-static-typing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ manager: craigg
5454

5555
If it is required after an implicit conversion, static type checking guarantees that only values of the allowed types with the correct cardinality are passed to an operation. For "string" + 1, it recognizes that the static type of "string" is **xs:string**. Because this is not an allowed type for the **+** operation, a type error is raised.
5656

57-
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.
57+
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.
5858

5959
As mentioned earlier, type inference frequently infers a type that is broader than what the user knows about the type of the data that is being passed. In these cases, the user has to rewrite the query. Some typical cases include the following:
6060

0 commit comments

Comments
 (0)