// run | |
// Copyright 2020 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
package main | |
type Recv <-chan int | |
type sliceOf[E any] interface { | |
type []E | |
} | |
func Append[S sliceOf[T], T any](s S, t ...T) S { | |
return append(s, t...) | |
} | |
func main() { | |
a := Append([]Recv{nil}, Recv(nil)) | |
if len(a) != 2 || a[0] != nil || a[1] != nil { | |
panic(a) | |
} | |
} |