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

Assignment to Constant Pkg Value in Gno #2836

Closed
omarsy opened this issue Sep 23, 2024 · 0 comments · Fixed by #2848
Closed

Assignment to Constant Pkg Value in Gno #2836

omarsy opened this issue Sep 23, 2024 · 0 comments · Fixed by #2848

Comments

@omarsy
Copy link
Member

omarsy commented Sep 23, 2024

Description

The following code snippet runs successfully in Gno and outputs here 3s, which is incorrect behavior since time.Second is a constant:

package main

import "time"

func main() {
	time.Second = 3 * time.Second
	println("here", time.Second)
}

Expected Behavior

This code should produce an error indicating that you cannot assign to time.Second, such as:

cannot assign to time.Second (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
Development

Successfully merging a pull request may close this issue.

1 participant