-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 vs wasm: x == arr[x]
#5271
Comments
FWIW it's compiled into that rego p = true { __local0__ = input.foos[__local0__] } The planner will plan this:
The relevant section is
which is simply kind of wrong. They key |
Previously, the planner didn't account for the variable to become known in the process of planning term b. In the case here, foo became known when planning the ref `input.foos[foo]`, the rhs of the `foo = input.foos[foo]` unification. Fixes open-policy-agent#5271. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Previously, the planner didn't account for the variable to become known in the process of planning term b. In the case here, foo became known when planning the ref `input.foos[foo]`, the rhs of the `foo = input.foos[foo]` unification. Fixes #5271. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
This one is hard to summarise, but the example is clear:
Note that it's important that the RHS is
input.foos
, since if the array was known, we'd get a compile time error:The text was updated successfully, but these errors were encountered: