cx
cx copied to clipboard
Panic when using void return value of a function in a for loop expression
@asahi3g commented on Mar 12
To Reproduce
package main
func foo()() {
}
func main() {
for foo() {
printf("true\n")
}
}
Expected behavior Compilation error
Screenshots
panic: runtime error: index out of range
goroutine 1 [running, locked to thread]:
github.com/skycoin/cx/cxgo/actions.IterationExpressions(0x0, 0x0, 0x0, 0xc0000100e0, 0x1, 0x1, 0x0, 0x0, 0x0, 0xc000010140, ...)
/home/reash/go/src/github.com/skycoin/cx/cxgo/actions/expressions.go:43 +0x11ba
main.yyParse(0xa849c0, 0xc00008e050, 0x0)
/home/reash/go/src/github.com/skycoin/cx/cxgo/cxgo.go:2391 +0xa17b
main.main()
/home/reash/go/src/github.com/skycoin/cx/cxgo/cxgo.nn.go:8848 +0x917
Desktop:
- OS: Linux
- CX Version : 0.6.1, d8775bf