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

cmd/compile: inlined calls to variadic functions do not type check (-l=3) #18116

Closed
davidlazar opened this issue Nov 30, 2016 · 1 comment
Closed

Comments

@davidlazar
Copy link
Member

x.go:

package main

func foo(xs ...string) {
}

func main() {
	foo("hello", "world")
}

Compilation fails:

$ go build -gcflags '-m -l=3' x.go 
# command-line-arguments
./x.go:3: can inline foo
./x.go:6: can inline main
./x.go:7: inlining call to foo
./x.go:3: foo xs does not escape
./x.go:7: invalid operation [2]string literal[:] (slice of unaddressable value)
./x.go:7: cannot use autotmp_0 (type [2]string) as type []string in assignment

$ go version
go version go1.7.3 linux/amd64
@davidlazar davidlazar self-assigned this Nov 30, 2016
@gopherbot
Copy link

CL https://golang.org/cl/33671 mentions this issue.

@golang golang locked and limited conversation to collaborators Nov 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants