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 Type as Value in Gno should be prohibited #2889

Closed
omarsy opened this issue Oct 2, 2024 · 0 comments · Fixed by #2896
Closed

Assigning Type as Value in Gno should be prohibited #2889

omarsy opened this issue Oct 2, 2024 · 0 comments · Fixed by #2896

Comments

@omarsy
Copy link
Member

omarsy commented Oct 2, 2024

Description

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

package main

func main() {
	t := struct{}
}

Expected Behavior

This code should not compile because a type cannot be assigned as a value in Gno.

ltzmaxwell pushed a commit that referenced this issue Nov 7, 2024
closes: #2889
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
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