Closed mvertes closed 1 year ago
sample.go
package main var a [len(prefix+path) + 2]int const ( prefix = "/usr/" path = prefix + "local/bin" ) func main() { println(len(a)) }
$ go run ./sample.go 21
$ yaegi ./sample.go run: ./sample.go:3:5: constant definition loop exit status 1
v0.15.1
It does not fail if the variable is defined after the constants.
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
v0.15.1
Additional Notes
It does not fail if the variable is defined after the constants.