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

no viable alternative error for Gobra keywords not allowed in Go code #692

Open
lmeinen opened this issue Oct 23, 2023 · 0 comments
Open

Comments

@lmeinen
Copy link

lmeinen commented Oct 23, 2023

The following code

package bar

func foo() {
	match := 1
}

throws the following error in v23.02

no viable alternative at input 'match :='
	match := 1
 ^^^^^^^^^^

Similar errors occur for other Gobra keywords, e.g. proof, domain, requires, etc.

Expected behavior would of course be that Gobra keywords are allowed within Go code. As a second option, it would be nice if the error were more descriptive. Note that this is the same error one gets when verifying invalid Gobra code directly, e.g.

package bar

requires
func foo() {
	someVar := 1
}

results in

no viable alternative at input 'func'
func foo() {
^^^^^^^^^^^^
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