microsoft / regorus

Regorus - A fast, lightweight Rego (OPA policy language) interpreter written in Rust.
MIT License
152 stars 34 forks source link

Parse error when rule body is parsed as a set instead of a comprehension #307

Closed anakrish closed 2 months ago

anakrish commented 2 months ago
import future.keywords

p if { 1 | [1,2][_] }

the rule body is parsed as a set resulting in

  |
5 | p if { 1 | [1,2][_] }
  |        ^
error: `union` expects set argument. Got `1` instead

It must be parsed as a comprehension instead.