cedar-policy / cedar

Implementation of the Cedar Policy Language
https://www.cedarpolicy.com
Apache License 2.0
897 stars 80 forks source link

Carry only `Loc` and not `Expr` on validator errors #1099

Closed john-h-kastner-aws closed 3 months ago

john-h-kastner-aws commented 4 months ago

Description of changes

Cleanup validation errors a bit by always carrying Loc on validation errors instead of sometimes storing an Expr. A lot of lines touched but mostly trivial test updates. I didn't go all the way to rewriting these tests to using ExpectedErrorMessage since that's a much larger test update for marginal benefit.

Shouldn't conflict with type resolution change, but this can wait a little bit in the interest of merging that.

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

I confirm that this PR (choose one, and delete the other options):

I confirm that cedar-spec (choose one, and delete the other options):