#260 NPE if arithmetic yields ()

v8.1.1
closed
5
2012-10-08
2004-11-01
Michael Kay
No

The XPath spec, and the Saxon 8.1 release, have changed
so that when an operand to an arithmetic expression is
an empty sequence, the result is an empty sequence.
However, the static type inferencing still assumes that
the result is always a single atomic value. This means
that no run-time type checking code is inserted in
places where an empty sequence would be an error, for
example the second argument of fn:subsequence(). If an
arithmetic expression in such a context does yield an
empty sequence, the consequence is a NullPointerException.

Discussion