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

unexpected "var requires evaluation" error from topdown #3369

Closed
tsandall opened this issue Apr 12, 2021 · 1 comment · Fixed by #3382
Closed

unexpected "var requires evaluation" error from topdown #3369

tsandall opened this issue Apr 12, 2021 · 1 comment · Fixed by #3382
Assignees
Labels

Comments

@tsandall
Copy link
Member

Given the following policy:

package x

p[a] {
    a := q
}

q[b] {
    b := 1
}

This query generates an error:

$ opa eval -b . -i input.json 'data.x.p[_]'
{
  "errors": [
    {
      "message": "var requires evaluation"
    }
  ]
}
@tsandall tsandall added the bug label Apr 12, 2021
@srenatus srenatus self-assigned this Apr 13, 2021
@srenatus
Copy link
Contributor

I'm looking into this. 🔍

srenatus added a commit to srenatus/opa that referenced this issue Apr 14, 2021
Before, we were passing `e.bindings` for both terms, result and e.rterm.
The result's bindings, however, are e.rbindings and we should be passing
those to biunify.

Fixes open-policy-agent#3369.
Fixes open-policy-agent#3376.

Co-authored-by: Torin Sandall <torinsandall@gmail.com>
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
srenatus added a commit that referenced this issue Apr 15, 2021
Before, we were passing `e.bindings` for both terms, result and e.rterm.
The result's bindings, however, are e.rbindings and we should be passing
those to biunify.

Fixes #3369.
Fixes #3376.

Co-authored-by: Torin Sandall <torinsandall@gmail.com>
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants