Files
Marc VertesandGitHub 67e92b9425 interp: fix computation of array size from constant expression
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.
2023-04-11 17:54:05 +02:00

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