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

Error message when using a keyword in ref should suggest ["keyword"] syntax #6432

Open
anderseknert opened this issue Nov 24, 2023 · 3 comments

Comments

@anderseknert
Copy link
Member

package p

r {
    input.default
}
opa eval -d p.rego -f pretty data.p.r
1 error occurred: p.rego:4: rego_parse_error: unexpected default keyword: expected ident
	input.default

This error message is difficult to understand, and does not provide a solution. If possible, we should suggest rewriting the ref to be input["default"]. Finally, let's try and avoid internal lingo like "ident" in these type of messages.

@srenatus
Copy link
Contributor

I'm agreeing with most points, but wouldn't it be great if the above was just valid? ✨ There's no ambiguity here. Same with input.default, input.with.foo, input.import.foobar, input.package... the list is long.

@anderseknert
Copy link
Member Author

That would be awesome! 🤩

Copy link

stale bot commented Dec 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants