opa icon indicating copy to clipboard operation
opa copied to clipboard

Unexpected recursion error on dotted rule head containing vars

Open tsandall opened this issue 8 months ago • 0 comments

I expected this policy to compile:

package play

import rego.v1

p[x].foo.bar if {
	x := "a"
	not p[x].foo.baz
}

p[x].foo.baz if { 
	x := "a"
	false
}

But got the following error:

1 error occurred: policy.rego:5: rego_recursion_error: rule data.play.p[__local0__].foo.bar is recursive: data.play.p[__local0__].foo.bar -> data.play.p[__local0__].foo.bar

It seems the recursion check is being overly conservative.

tsandall avatar Jun 11 '24 19:06 tsandall