Open
Description
Go version
tip
Output of go env
in your module/workspace:
.
What did you do?
https://tip.golang.org/ref/spec#Close
If the type of the argument to close is a type parameter, all types in its type set must be channels with the same element type.
What did you see happen?
The code compiles:
func dig[T ~chan int | ~chan bool | ~chan<- string](x T) {
close(x)
}
What did you expect to see?
I tend to think this is a spec bug.