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

Type errors for undefined functions can contain rewritten vars #4031

Closed
tsandall opened this issue Nov 18, 2021 · 0 comments · Fixed by #4034
Closed

Type errors for undefined functions can contain rewritten vars #4031

tsandall opened this issue Nov 18, 2021 · 0 comments · Fixed by #4034
Assignees
Labels

Comments

@tsandall
Copy link
Member

tsandall commented Nov 18, 2021

Example:

$ opa eval 'a := "x"; data[a](1)'
{
  "errors": [
    {
      "message": "undefined function data[__localq0__]",
      "code": "rego_type_error",
      "location": {
        "file": "",
        "row": 1,
        "col": 11
      }
    }
  ]
}

The error contains a rewritten var __localq0__ when it should contain the user-defined var a. This is probably just a matter if doing a lookup on the rewritten var map when the error is raised.

@tsandall tsandall added the bug label Nov 18, 2021
@srenatus srenatus self-assigned this Nov 18, 2021
srenatus added a commit to srenatus/opa that referenced this issue Nov 19, 2021
Fixes open-policy-agent#4031.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
srenatus added a commit that referenced this issue Nov 19, 2021
…#4034)

Fixes #4031.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
floriangasc pushed a commit to floriangasc/opa that referenced this issue Nov 22, 2021
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