Open mstevan opened 3 years ago
Thank you for looking into this.
That's because in JSONiq, arrays cannot be atomized, so the error is expected.
In XQuery they can so what happens is that [1,2,3,4,5] is converted to (1,2,3,4,5) and then min called.
In your implementation, what you can do is add an iterator for atomizing sequences, and in the translationvisitor for the XQuery 3.1 parser, you can insert that iterator in the middle between an argument and a function call iterator whenever the type is atomic with any arity.
@mstevan test-set: max.xml, min.xml test-cases: fn-max-19 and fn-min-19
@team Seems that min and max function do not work on arrays
Input: min([1,2,3,4,5])
Output: ⚠️ ️There was an error.
Code: [XPTY0004] (this code can be looked up in the documentation and specifications).
Location information: file:/Users/mstevan/Documents/:LINE:1:COLUMN:0:
Invalid return type for function min. array cannot be promoted to type atomic?.
Expected output: 1