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

floats not allowed in inc/dec statements #1151

Closed
thehowl opened this issue Sep 18, 2023 · 0 comments · Fixed by #1221
Closed

floats not allowed in inc/dec statements #1151

thehowl opened this issue Sep 18, 2023 · 0 comments · Fixed by #1221
Assignees
Labels
🐞 bug Something isn't working 📦 🤖 gnovm Issues or PRs gnovm related

Comments

@thehowl
Copy link
Member

thehowl commented Sep 18, 2023

package main

func main() {
        var i float64
        i++
}
$ gno run a.gno
panic running expression main(): unexpected type in in operation

main.runExpr.func1()
        /home/howl/oc/gno2/gnovm/cmd/gno/run.go:158 +0x138
panic({0xbeb9a0, 0xf46680})
        /usr/lib/go/src/runtime/panic.go:884 +0x213
github.com/gnolang/gno/gnovm/pkg/gnolang.(*Machine).doOpInc(0xc0000c4a20)
        /home/howl/oc/gno2/gnovm/pkg/gnolang/op_inc_dec.go:46 +0x55d

It seems to just be missing from the type switch.

(substituting inc/dec statements with x += 1 or x -= 1 works)

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
Status: 🚀 Needed for Launch
Development

Successfully merging a pull request may close this issue.

1 participant