open-policy-agent / opa

Open Policy Agent (OPA) is an open source, general-purpose policy engine.
https://www.openpolicyagent.org
Apache License 2.0
9.52k stars 1.32k forks source link

Improve type checker error readability #499

Open tsandall opened 6 years ago

tsandall commented 6 years ago

In some cases, the type checker errors become overly verbose. E.g,. the following error was generated by trying to union an object and a set:

rego_type_error: or: invalid argument(s)
    have: (set[object<action: set[string], object: string>], object<action: set[string], object: string>, ???)
    want: (set[any], set[any], set[any])

One improvement would be to elide type information so that the top-most differing types are emphasized. For example:

have (set[…], object<…>, ???)
want (set[...], set[...], set[...])
stale[bot] commented 2 years ago

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] commented 2 years ago

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.