You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the not() function has been implemented in the meantime but the issue persists. When I write not("some") it works fine and gives false. but not("some") eq true fails with
not("something") eq true
^
Code: [XPTY0004]
Message: "eq": operation not possible with parameters of type "xs:string" and "xs:boolean"
Rumble thinks not("some")is a string. making not explicit with fn:not("some") eq true fixes it.
Not sure if its a parser bug or expected because of the not prefix operator (ideally we could support both?)
What actuall happens here is that not("some") eq trueis evaluated as not ("some" eq true) because not binds weaker than eq. ANTLR lookahead if possible could maybe fix this if it knows it should be a functioncall due to the parenthesis.
For JSONiq 3.1 we can consider removing the not prefix operator and just use not() to align better with xquery3.1. This has to be considered/discussed. This would fix the inconsistency. But for now its not a big problem
@mstevan
test-set: not.xml
test-cases: fn-not-5 to fn-not-16
@team
Not behaves weirdly when having two not calls within same query.
not("true") or not("true") for example works but not("true") eq not("true")
List of operators to test with because it throws exception:
Eq,ne,lt,le,gt,ge,=,!=,<,<=,>,>=
Input:
not("true") eq not("true")
Output:
⚠️ ️There was an error.
Code: [XPST0017] (this code can be looked up in the documentation and specifications).
Location information: file:/Users/mstevan/Documents/:LINE:1:COLUMN:15:
Undefined function call; Entered function name and arity doesn't match a defined function signature: "not" called with 1 parameters.
Expected output:
true
The text was updated successfully, but these errors were encountered: