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
The "unexpected assign token" seems to be everywhere when := is used for rule assignment, and replacing it for = often reveals the real error. We really ought to fix this, as the idiomatic option currently leads to a degraded developer experience :/
package play
s :="a
1 error occurred: policy.rego:3: rego_parse_error: unexpected assign token: expected rule value term (e.g., s := <VALUE> { ... })
s := "a
vs.
package play
s ="a
3 errors occurred:
policy.rego:3: rego_parse_error: non-terminated string
s = "a ^policy.rego:3: rego_parse_error: illegal token s = "a
^
policy.rego:3: rego_parse_error: illegal token
s = "a ^
(we could probably do without the "illegal token" errors here, but at least the real error is presented)
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. Although currently inactive, the issue could still be considered and actively worked on in the future. More details about the use-case this issue attempts to address, the value provided by completing it or possible solutions to resolve it would help to prioritize the issue.
Continuation of #6432
If the same expression is moved to the rule head, the error message is completely untrue:
Interestingly, using
=
instead of:=
results in a better error message, although for some reason repeated in two variations:Fixing this along with #6432 would help empower users to identify and fix mistakes they've made.
The text was updated successfully, but these errors were encountered: