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

incorrect const init #3430

Closed
ltzmaxwell opened this issue Dec 31, 2024 · 1 comment
Closed

incorrect const init #3430

ltzmaxwell opened this issue Dec 31, 2024 · 1 comment
Assignees
Labels
🐞 bug Something isn't working 📦 🤖 gnovm Issues or PRs gnovm related

Comments

@ltzmaxwell
Copy link
Contributor

Description

see this:

package main

func main() {
	var s = make([][2]string, 1) // Slice with length 1
	s[0] = [2]string{"a", "b"}   // Assign value to s[0]
	const r = len(s[0])
	println(r) // Prints: 2
}

it should output 2, in Go, but got panic: nil slice index (out of bounds) in Gno.

@omarsy
Copy link
Member

omarsy commented Feb 3, 2025

This PR #3600 should also resolve this issue.

@petar-dambovaliev petar-dambovaliev moved this from In Progress to Done in 🧙‍♂️gno.land core team Feb 4, 2025
@Kouteki Kouteki closed this as completed Feb 7, 2025
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

No branches or pull requests

5 participants