Incorrect Invalid path expression
in destructuring expressions
#3128
Labels
Invalid path expression
in destructuring expressions
#3128
Compare
jq -n 'path({} as {$a} | .)'
tojq -n 'path(. as {$a} | .)'
. The first yields an error:Invalid path expression near attempt to access element "a" of {}
, while the latter yields["a"]
, but in both cases the expression whose values are being destructured do not contribute to path traversal -- they contribute only to establishment of bindings for the the expression to the right.This issue was reported by @wader.
gojq
does not have this bug.The following patch looks right but needs testing (I'm not sure about which should come first, the
SUBEXP_END
or thePOP
):The text was updated successfully, but these errors were encountered: