Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Policy Compiler] Surface type-mismatches error in a more readable fashion #973

Closed
l46kok opened this issue Jul 3, 2024 · 0 comments · Fixed by #992
Closed

[Policy Compiler] Surface type-mismatches error in a more readable fashion #973

l46kok opened this issue Jul 3, 2024 · 0 comments · Fixed by #992
Assignees

Comments

@l46kok
Copy link
Collaborator

l46kok commented Jul 3, 2024

Policy compiler will fail to type-check the composed policies (expectedly) if their output types are different. Example:

name: foo_policy
rule:
    match:
       - condition: x
         output: "error"
       - output: true
Compile() failed: ERROR: testdata/nested_rule/policy.yaml:-1:0: found no matching overload for '_?_:_' applied to '(bool, map(string, bool), string)'

We should try to raise this error in a more readable fashion, and ideally with the source positions wrt/ yaml.

(xref b/350064634 for Java impl)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants