Closed
Description
by yiyu.jgl:
What steps will reproduce the problem? // Example: package main func main() { _ = &append([]int{1, 2}, 3)[:] } What is the expected output? A successful compile. What do you see instead? prog.go:4: cannot take the address of append(slice literal, 3)[:] Which compiler are you using (5g, 6g, 8g, gccgo)? Which operating system are you using? Which revision are you using? (hg identify) Go Playground at golang.org Please provide any additional information below. In my opinion, it should be possible to directly take the address of append, as in &append(a, b), but I'm not sure the spec allows it. However, it specifically says the address operator can be used with an slice indexing operation, so I think it should work for &append(a, b)[:]