regal icon indicating copy to clipboard operation
regal copied to clipboard

Complete rules and function should avoid returning var bound in iteration

Open anderseknert opened this issue 1 year ago • 1 comments

Will the below policy work or not?

package play

f(arr) := upper(arr[_])

x := f(input.arr)

The answer depends on the number of elements in input.arr. 1 item is fine, more than that and you'll get:

policy.rego:3: eval_conflict_error: functions must not produce multiple outputs for same inputs

The big problem with this is that you can test, publish and run a policy for days or longer, before the problem manifests at runtime. The compiler accepts this, but it would be extremly helpful if Regal didn't.

anderseknert avatar Mar 15 '23 09:03 anderseknert