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

nil value interface bug #3758

Closed
petar-dambovaliev opened this issue Feb 15, 2025 · 0 comments · Fixed by #3843
Closed

nil value interface bug #3758

petar-dambovaliev opened this issue Feb 15, 2025 · 0 comments · Fixed by #3843
Assignees
Labels
🐞 bug Something isn't working 📦 🤖 gnovm Issues or PRs gnovm related

Comments

@petar-dambovaliev
Copy link
Contributor

Gnovm panics on this valid code

package main

type Writer interface {
	Write([]byte) (int, error)
}

type Stringer interface {
	String() string
}

func main() {
	var x interface {
		Writer
		Stringer
	}
	var w Writer = Writer(x) // explicit conversion
	println(w)
}

Expected to see
(0x0,0x0)

Got

Machine.RunMain() panic: interface method call on undefined value
@petar-dambovaliev petar-dambovaliev added 📦 🤖 gnovm Issues or PRs gnovm related 🐞 bug Something isn't working labels Feb 15, 2025
@Kouteki Kouteki moved this from Triage to In Progress in 🧙‍♂️gno.land core team Feb 17, 2025
@Kouteki Kouteki moved this from In Progress to Todo in 🧙‍♂️gno.land core team Feb 17, 2025
@petar-dambovaliev petar-dambovaliev moved this from Todo to In Review in 🧙‍♂️gno.land core team Feb 27, 2025
thehowl added a commit that referenced this issue Feb 28, 2025
Closes [3768](#3768), closes
[3758](#3758)

---------

Co-authored-by: Morgan Bazalgette <morgan@morganbaz.com>
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.

1 participant