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
This should fail as sum only accepts numeric values. However, it doesn't. When the value is used directly, the type checker correctly reports the error.
Could be that there are more examples where the type isn't correctly inferred — I haven't looked into that. This was just something that I hit when working on Regal this evening.
The text was updated successfully, but these errors were encountered:
anderseknert
changed the title
Type checker fails to identify type error from rule reference
Type checker fails to identify type from reference
Jan 16, 2025
While I haven’t done a proper bisect, testing this out with some OPA binaries I had laying around, this bug is at least not a recent regression.
OPA v0.17.0(!!) correctly identifies this as a type error, but not OPA v0.30.0 or anything later I ran with. I did not test any version between those two, but I don't think it matters much. I'm surprised this hasn't been reported in all this time though! Fixing it would be great, as I'm sure those new to Rego and all the built-in functions are going to spend even more time than I did trying to understand what they did wrong.
No error reported
This should fail as sum only accepts numeric values. However, it doesn't. When the value is used directly, the type checker correctly reports the error.
Error reported
Playground
Could be that there are more examples where the type isn't correctly inferred — I haven't looked into that. This was just something that I hit when working on Regal this evening.
The text was updated successfully, but these errors were encountered: