mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-14 04:12:41 -06:00
dc2019de57
With func1.rego as
package test
r(x) {
data.test.q(x)
}
q(_) = true
q(_) = false
Before:
$ opa eval -fpretty -d func1.rego 'data.test.r(1)'
true
After:
$ opa eval -fpretty -d func1.rego 'data.test.r(1)'
1 error occurred: func1.rego:12: eval_conflict_error: functions must not produce multiple outputs for same inputs
Fixes #3912.
Also adds a CHANGELOG item making the backwards-compat-breaking change
prominent, and sharing an example of how to fix it.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
33 lines
648 B
YAML
33 lines
648 B
YAML
cases:
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test1
|
|
|
|
p(a) = y {
|
|
y = a[_]
|
|
}
|
|
|
|
r = y {
|
|
data.test1.p([1, 2, 3], y)
|
|
}
|
|
note: functionerrors/function output conflict single
|
|
query: data.test1.r = x
|
|
want_error: functions must not produce multiple outputs for same inputs
|
|
want_error_code: eval_conflict_error
|
|
- data:
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
f(_) = true
|
|
f(_) = false
|
|
|
|
r {
|
|
data.test.f(1)
|
|
}
|
|
note: functionerrors/function output conflict, used as boolean
|
|
query: data.test.r = x
|
|
want_error: functions must not produce multiple outputs for same inputs
|
|
want_error_code: eval_conflict_error
|