Files
moxa/_test/issue-1470.go
Marc Vertes a5242cbb9e interp: retry type definition if an array size is undefined
In case of forward definition of a constant, a symbol may be undefined when attempting to compute the array size in type analysis. Just mark the type as incomplete instead of aborting directly, to allow resolution at a second pass.

Fixes #1470.
2022-10-24 10:44:06 +02:00

16 lines
134 B
Go

package main
type T struct {
num [tnum + 2]int
}
const tnum = 23
func main() {
t := T{}
println(len(t.num))
}
// Output:
// 25