Closed
Description
Expected Behavior
An expression like:
package example
p {
x := {"foo": (1+2) | 1}
}
Should be defining an object comprehension (to be inline with behavior of array and set with these ambiguous |
cases).
Actual Behavior
It gets parsed as an object where the value for "foo"
has an or
call.
$ opa parse /tmp/x.rego 'data'
module
package
ref
data
"example"
rule
head
p
true
body
expr index=0
ref
eq
x
object
"foo"
call
ref
or
call
ref
plus
1
2
1
Additional Info
Part of the inconsistency is that if there is no call (the 1+2
) then it is parsed as an object comprehension.
package example
p {
x = {"foo": 1 | 1}
}
Yields
$ opa parse /tmp/x.rego 'data'
module
package
ref
data
"example"
rule
head
p
true
body
expr index=0
ref
eq
x
objectcomprehension
"foo"
1
body
expr index=0
1
Activity