Skip to content

gccgo: mishandles iota in len([iota]int{}) expression #22341

@mdempsky

Description

@mdempsky

https://play.golang.org/p/ZBwHogxkJp

package main

const (
        m = len([iota]int{})
        n
        o
)

func main() {
        println(m, n, o)
}

prints "0 1 2" with cmd/compile, but "0 0 0" with gccgo.

/cc @ianlancetaylor

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions