-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
The compiler issues error constant definition loop for the following program:
package main
import "fmt"
const C = len(u)
func f() ([1]int, [C]float64) {
return [...]int{1}, [...]float64{1.1}
}
var u, v = f()
func main() {
fmt.Println(C, v)
}In fact the value if C (resp. the type of u) does not depend on the type of the second return of f.
The same program is compiled successfully by gccgo.
PS. Another test case
package main
import "fmt"
const C = len(u)
type S struct {
X [1]int
Y [C]int
}
var s S
var u, v = s.X, s.Y
func main() {
fmt.Println(C, v)
}Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.