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

Mishandling of type redeclaration #3203

Closed
mvertes opened this issue Nov 26, 2024 · 1 comment · Fixed by #3222
Closed

Mishandling of type redeclaration #3203

mvertes opened this issue Nov 26, 2024 · 1 comment · Fixed by #3222
Assignees
Labels
🐞 bug Something isn't working 📦 🤖 gnovm Issues or PRs gnovm related

Comments

@mvertes
Copy link
Contributor

mvertes commented Nov 26, 2024

The following valid Go code fails with gno:

package main

type (
	Number  = int32
	Number2 = Number
)

func f(n Number2) { println(n) }

func main() {
	var n Number = 5
	f(n)
}

// Output:
// 5
@mvertes
Copy link
Contributor Author

mvertes commented Nov 26, 2024

See also the following variant of the same problem:

package main

type Number = int

func main() {
	println(Number(1) < int(2))
}

// Output: true

@Kouteki Kouteki moved this from Triage to Backlog in 🧙‍♂️gno.land core team Nov 26, 2024
@Kouteki Kouteki added this to the ⏭️Next after mainnet milestone Nov 26, 2024
@Kouteki Kouteki moved this from Backlog to Todo in 🧙‍♂️gno.land core team Nov 27, 2024
@hthieu1110 hthieu1110 self-assigned this Nov 27, 2024
@Kouteki Kouteki moved this from Todo to In Progress in 🧙‍♂️gno.land core team Nov 28, 2024
zivkovicmilos pushed a commit that referenced this issue Dec 3, 2024
Fixes: #3203

<!-- 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
</details>
@github-project-automation github-project-automation bot moved this from In Progress to Done in 🧙‍♂️gno.land core team Dec 3, 2024
r3v4s pushed a commit to gnoswap-labs/gno that referenced this issue Dec 10, 2024
…3222)

Fixes: gnolang#3203

<!-- 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
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📦 🤖 gnovm Issues or PRs gnovm related
Projects
Development

Successfully merging a pull request may close this issue.

4 participants