forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ast: Fix rewriting vars in rule args
Vars declared as rule args were not being rewritten which lead to namespace conflicts with built-in functions. For example, definitions like `f(object) { object[x] = 1 }` would generate type checking errors because the checker would treat `object[x] = 1` as referring to the `object` built-in function namespace. This change updates the compiler to rewrite rule arguments just like it does other declared variables. Fixes open-policy-agent#2080 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Showing
2 changed files
with
125 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters