Skip to content

Strange x = y // z precedence #3507

@A4-Tacks

Description

@A4-Tacks

Describe the bug
The alternate operator has a higher precedence than the assignment operator, which is more practical, and vice versa is not very reasonable

To Reproduce

$ jq -n '.[0]=null//2'
[
  null
]
$ jq -n '.[0]=(null//2)'
[
  2
]

Expected behavior

[
  2
]
[
  2
]

Environment (please complete the following information):

  • OS and Version: Arch Linux
  • jq version 1.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions