Skip to content

Likely wrong precedence of the 'as' operator  #2446

Closed
@ksa-real

Description

@ksa-real

Describe the bug

In the example below the numbers are squared while the output is expected to be the same as input

$ jq '.[]|.*3 as $v|.' <<<'[1, 4, 5,3]'
1
16
25
9

Similarly input is doubled but should be the same:

$ jq '.[]|.+1 as $v|.' <<<'[1, 4, 5,3]'
2
8
10
6

Environment (please complete the following information):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions