You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type checker currently reports "undefined function" errors if a rule/query refers to a function that itself contains type errors. If an error is introduced into a function that's called in a large number of locations the errors reported by OPA can be extremely noisy and make it difficult to understand the problem (especially since by default OPA will only report up to 10 errors before stopping.)
In cases where "undefined function" errors are due to the referenced function itself containing an error, the type checker can drop/ignore the error. One simple way to implement this would be to simply drop/ignore "undefined function" errors if there is an existing error in the type checking pass.
Example:
package x
p {
f(1)
}
f(x) {
max("foo") # max requires an array
}
The text was updated successfully, but these errors were encountered:
Earlier if a rule/function contained an error, the type checker would not update the env with subsequent independent rules resulting in errors such as "undefined functions". This change add erroneous rules/functions to the env to avoid such type errors.
Fixesopen-policy-agent#2155Fixesopen-policy-agent#2091
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
Earlier if a rule/function contained an error, the type checker would not update the env with subsequent independent rules resulting in errors such as "undefined functions". This change add erroneous rules/functions to the env to avoid such type errors.
Fixes#2155Fixes#2091
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
The type checker currently reports "undefined function" errors if a rule/query refers to a function that itself contains type errors. If an error is introduced into a function that's called in a large number of locations the errors reported by OPA can be extremely noisy and make it difficult to understand the problem (especially since by default OPA will only report up to 10 errors before stopping.)
In cases where "undefined function" errors are due to the referenced function itself containing an error, the type checker can drop/ignore the error. One simple way to implement this would be to simply drop/ignore "undefined function" errors if there is an existing error in the type checking pass.
Example:
The text was updated successfully, but these errors were encountered: