Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rego.v1: rego_parse_error: rule must have value assignment and/or body declaration #6364

Closed
anderseknert opened this issue Oct 30, 2023 · 0 comments · Fixed by #6368
Closed
Assignees
Labels

Comments

@anderseknert
Copy link
Member

package play

import future.keywords.if

foo(a, b) if {
    f(a)
} else if {
    f(b)
} else := false

f(_)

This policy parses as expected, but chaging the import future.keywords.if to import rego.v1 and re-evaluating renders:

1 error occurred: policy.rego:9: rego_parse_error: rule must have value assignment and/or body declaration

(line 9 is } else := false)

I don't think this is expected. If it is, it's not clear to me what should be changed.

Playground

@johanfylling johanfylling self-assigned this Oct 31, 2023
johanfylling added a commit to johanfylling/opa that referenced this issue Oct 31, 2023
for rules/functions that only has value assignment for `else` but not "primary" head

Fixes: open-policy-agent#6364
Signed-off-by: Johan Fylling <[email protected]>
ashutosh-narkar pushed a commit to johanfylling/opa that referenced this issue Oct 31, 2023
for rules/functions that only has value assignment for `else` but not "primary" head

Fixes: open-policy-agent#6364
Signed-off-by: Johan Fylling <[email protected]>
ashutosh-narkar pushed a commit to johanfylling/opa that referenced this issue Oct 31, 2023
for rules/functions that only has value assignment for `else` but not "primary" head

Fixes: open-policy-agent#6364
Signed-off-by: Johan Fylling <[email protected]>
johanfylling added a commit that referenced this issue Nov 1, 2023
for rules/functions that only has value assignment for `else` but not "primary" head, when `rego.v1` is imported.

Fixes: #6364

Signed-off-by: Johan Fylling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants