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

Assigning a value to Function Name in Gno should be prohibited #2840

Open
omarsy opened this issue Sep 24, 2024 · 0 comments
Open

Assigning a value to Function Name in Gno should be prohibited #2840

omarsy opened this issue Sep 24, 2024 · 0 comments

Comments

@omarsy
Copy link
Member

omarsy commented Sep 24, 2024

Description

The following code snippet compiles and runs successfully in Gno, which is incorrect behavior:

package main

func v() {}
func main() {
	v = func() {}
	println(v)
}

Expected Behavior

This code should produce an error indicating that you cannot assign to the function name v, such as:

cannot assign to v (neither addressable nor a map index expression)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

1 participant