(int div int) gives ClassCastException
The Saxon XSLT and XQuery processor, developed by Saxonica
Brought to you by:
mhkay
The static type of ($x div 2) where $x is an integer,
is being wrongly inferred as xs:integer rather than
xs:decimal. This can lead to a ClassCastException if
the result is used in a context where an integer is
expected, for example
1 to xs:integer($x div 2)
Occurs in 7.6.5 and possibly earlier releases.
Source code fixed (extra logic added to getItemType()
in ArithmeticExpression.
Test case added: bug97