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
This was reported as a side-effect in #6433 but this is actually the main issue, so I'll close that in favor if this one. We really ought to look into the parse error of "unexpected assign token" as it's:
Very frequently reported
Wrong
Hides actual issues from users, thus making Rego development harder than it should be
This is especially problematic for users new to Rego, which makes this a high priority to fix.
Compare:
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 ^
But essentially any errors reported on the right hand side of the assignment operator (:=) will be reported the same way, while using = instead provides the user with the actual error.
Using := is recommended over = and has been for a long time, which explains why this is such a commonly reported error.
The text was updated successfully, but these errors were encountered:
This one has been among my top annoyances, and thanks to @johanfylling,
it was easy to finally track down. Had to update a few tests, but not too
many.
Fixesopen-policy-agent#6563
Signed-off-by: Anders Eknert <anders@styra.com>
This one has been among my top annoyances, and thanks to @johanfylling,
it was easy to finally track down. Had to update a few tests, but not too
many.
Fixesopen-policy-agent#6563
Signed-off-by: Anders Eknert <anders@styra.com>
…#6778)
This one has been among my top annoyances, and thanks to @johanfylling,
it was easy to finally track down. Had to update a few tests, but not too
many.
Fixes#6563
Signed-off-by: Anders Eknert <anders@styra.com>
This was reported as a side-effect in #6433 but this is actually the main issue, so I'll close that in favor if this one. We really ought to look into the parse error of "unexpected assign token" as it's:
This is especially problematic for users new to Rego, which makes this a high priority to fix.
Compare:
vs.
But essentially any errors reported on the right hand side of the assignment operator (
:=
) will be reported the same way, while using=
instead provides the user with the actual error.Using
:=
is recommended over=
and has been for a long time, which explains why this is such a commonly reported error.The text was updated successfully, but these errors were encountered: