Why does this code not compile: https://play.golang.org/p/f5fMvO8Ns7

package main


import (
 "fmt"
)


func f(items ...interface{}) {
 fmt.Println(items)
}


func main() {
 f("a", "b", "c")
 tab := []interface{}{"d"}
 f("a", "b", "c", tab...)
}


The spec says:
> Otherwise, the value passed is a new slice of type []T with a new 
underlying array whose successive elements are the actual arguments, which 
all must be assignable <https://golang.org/ref/spec#Assignability> to T.

The elements are assignable. So what spec clause exactly prevents this from 
compile?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to