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

Match error with comprehension not suppressed #438

Closed
tsandall opened this issue Aug 30, 2017 · 0 comments
Closed

Match error with comprehension not suppressed #438

tsandall opened this issue Aug 30, 2017 · 0 comments

Comments

@tsandall
Copy link
Member

tsandall commented Aug 30, 2017

If an expression contains a match error because one or more values cannot be inferred and the cause is due to an earlier type error, the compiler should not report the match error.

We already suppress these kinds of match errors for ref errors.

For example:

OPA 0.5.7-dev (commit 69c0d823, built at 2017-08-30T23:12:19Z)

Run 'help' to see a list of commands.

> _ = [true | 1 = "foo"]
2 errors occurred:
1:1: rego_type_error: match error
	left  : ???
	right : ???
1:13: rego_type_error: match error
	left  : number
	right : string
tsandall added a commit to tsandall/opa that referenced this issue Aug 31, 2017
These changes modify the type checker to run on closures contained in
the expression before the containing expression. This way the type
checker can suppress less specific/actionable match errors in the same
way it does for ref errors.

Fixes open-policy-agent#438
tsandall added a commit that referenced this issue Aug 31, 2017
These changes modify the type checker to run on closures contained in
the expression before the containing expression. This way the type
checker can suppress less specific/actionable match errors in the same
way it does for ref errors.

Fixes #438
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

No branches or pull requests

1 participant