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.
16 lines
134 B
Go
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
|