Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal compiler error: bad type for ... argument: [2]string #45913

Closed
magisterquis opened this issue May 2, 2021 · 4 comments
Closed

internal compiler error: bad type for ... argument: [2]string #45913

magisterquis opened this issue May 2, 2021 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@magisterquis
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.16.3 openbsd/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/stuart/.cache/go-build"
GOENV="/home/stuart/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="openbsd"
GOINSECURE=""
GOMODCACHE="/home/stuart/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="openbsd"
GOPATH="/home/stuart/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/stuart/.goroot"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/stuart/.goroot/pkg/tool/openbsd_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="0"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build912392299=/tmp/go-build -gno-record-gcc-switches"

What did you do?

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

What did you expect to see?

a b

What did you see instead?

/home/stuart/c.go:10:3: internal compiler error: bad type for ... argument: [2]string

@magisterquis
Copy link
Author

Also happens with https://play.golang.org/p/KaRJNwngIab, not that it should compile anyways.

@ALTree
Copy link
Member

ALTree commented May 2, 2021

Thanks for reporting this.

Still broken on tip:

$ gotip version
go version devel go1.17-879db69ce2 Sat May 1 11:43:19 2021 +0000 linux/amd64

$ gotip tool compile test.go
test.go:10:3: internal compiler error: bad type for ... argument: [2]string

cc @randall77 @mdempsky

@ALTree ALTree added this to the Go1.17 milestone May 2, 2021
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 2, 2021
@cuonglm
Copy link
Member

cuonglm commented May 2, 2021

The internal compiler error was added in df73945

Previously, the compiler reports:

main.go:10:3: not enough arguments in call to f
	have (...string)
	want (string, string)

which sounds wrong to me, though. It. should report that ... is used in non-variadic function.

cc @mdempsky

@gopherbot
Copy link

Change https://golang.org/cl/315796 mentions this issue: cmd/compile: make typecheckaste correctly report invalid use of "..."

@golang golang locked and limited conversation to collaborators May 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants