fix: Implement RVM set ops correctly

- treat set subtraction in RVM the same as the interpreter by supporting
  Value::Set operands in sub_values
- emit internal-only builtin names for set union/intersection and register
  handlers so compiled bytecode resolves without exposing new Rego builtins
- add regression coverage for literal set difference/intersection
  (x/y from failure.rego) in tests/rvm/rego/cases/sets.yaml

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2025-12-03 14:38:17 -06:00
parent 252ae0e312
commit a514e8da83
4 changed files with 58 additions and 2 deletions
+20
View File
@@ -67,3 +67,23 @@ cases:
- set!: [1, 2]
- set!: [3, 4]
- set!: ["a", "b"]
- note: set_difference_literals
data: {}
modules:
- |
package test
x := {2, 3} - {4, 2}
query: data.test.x
want_result:
set!: [3]
- note: set_intersection_literals
data: {}
modules:
- |
package test
y := {2, 3} & {4, 2}
query: data.test.y
want_result:
set!: [2]