mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
The result of the expression giving the size of an array may be an `int` instead of `constant.Value` in case of an out of order declaration. Handle both cases. Fixes #1536.
16 lines
158 B
Go
16 lines
158 B
Go
package main
|
|
|
|
var a [len(prefix+path) + 2]int
|
|
|
|
const (
|
|
prefix = "/usr/"
|
|
path = prefix + "local/bin"
|
|
)
|
|
|
|
func main() {
|
|
println(len(a))
|
|
}
|
|
|
|
// Output:
|
|
// 21
|