If a query contains a filter expression whose predicate
is a compile-time constant, and has an incorrect type
(a type such as xs:hexBinary for which no effective
boolean value is defined) then a NullPointerException
is thrown at compile-time instead of reporting a proper
This is shown by XQTS test case K-FilterExpr-91.
(Saxon's test driver failed to distinguish the NPE from
a normal compile-time error, merely reporting that the
wrong error code was signaled).
The code (in net.sf.saxon.expr.FilterExpression) will
be patched in Subversion.