What version of Go are you using (go version)?
$ go version
go version go1.15 linux/amd64
Does this issue reproduce with the latest release?
It doesn't reproduce with Go 1.13. It does reproduce with Go 1.14, 1.15, and +721819e7ba. Going to rebuild a more fresh Go, try the tip, and update the issue in a moment.
Update: also reproduces with:
$ go version
go version devel +5cc030aa19 Sun Sep 6 20:23:50 2020 +0000 linux/amd64
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ainar/.cache/go-build"
GOENV="/home/ainar/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ainar/go/pkg/mod"
GONOPROXY="REDACTED"
GONOSUMDB="REDACTED"
GOOS="linux"
GOPATH="/home/ainar/go"
GOPRIVATE="REDACTED"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/ainar/go/go1.15"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/ainar/go/go1.15/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build723473563=/tmp/go-build -gno-record-gcc-switches"
What did you do?
https://play.golang.org/p/rHDhklq4E7D
func f() [2]int {
return [...]int{2: 0}
}
What did you expect to see?
In Go 1.13:
# command-line-arguments
go/tmp.go:4:17: cannot use [3]int literal (type [3]int) as type [2]int in return argument
What did you see instead?
# command-line-arguments
go/tmp.go:4:17: cannot use [<node DDD>]int literal (type [3]int) as type [2]int in return argument
I saw that on @davecheney's Twitter and tried looking up “node DDD” in existing issues. There didn't seem to be one, so I filed this one.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
It doesn't reproduce with Go 1.13. It does reproduce with Go 1.14, 1.15, and
+721819e7ba. Going to rebuild a more fresh Go, try the tip, and update the issue in a moment.Update: also reproduces with:
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
https://play.golang.org/p/rHDhklq4E7D
What did you expect to see?
In Go 1.13:
What did you see instead?
I saw that on @davecheney's Twitter and tried looking up “node DDD” in existing issues. There didn't seem to be one, so I filed this one.