[The spec says](https://tip.golang.org/ref/spec#Close): > If the type of the argument to close is a [type parameter](https://tip.golang.org/ref/spec#Type_parameter_declarations), all types in its type set must be channels with the same element type. But the code compiles (since 1.18): ```Go func dig[T ~chan int | ~chan bool | ~chan<- string](x T) { close(x) } ``` So maybe it is a good idea to just remove the about quoted line from spec.