Hello,

I observed a strange behavior concerning the sequence type matching of function 
arguments.

Consider this function:
declare function op:filterPersonIndex($filter as element(), $unfilteredIndex as 
xs:int) as xs:int {
   if (empty($filter)) then $unfilteredIndex else ...};

If this function is called with an empty sequence as first argument, an 
exception must be thrown, as the sequence type "element()" does not 
match the empty sequence.

What actually happens is something else: no error is thrown, and an empty 
sequence is returned, which should not be possible due to the signature. 
Insertion of log statements shows that neither the true branch, nor the false 
branch is evaluated. In other words: the function is not evaluated at all, and 
the function call evaluates to an empty sequence.

Kind regards,Hans-Juergen Rennau
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to