From: Robert Griesemer Date: Tue, 2 Dec 2025 22:32:13 +0000 (-0800) Subject: spec: remove restriction on channel element types for close built-in (bug fix) X-Git-Tag: go1.26rc1~16 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1a64db3a4b;p=gostls13.git spec: remove restriction on channel element types for close built-in (bug fix) The spec states that if the argument type for close is a type parameter, it's type set must only contain channels and they must all have the same element type. This latter requirement (all must have the same element type) was never enforced by the compiler, nor is it important for correctness or required by the implementation. This change removes this requirement also in the spec and thus documents what was always (since 1.18) the case. Fixes #74034. Change-Id: If65d50bfb581b7f37999413088d3d3b1820e054a Reviewed-on: https://go-review.googlesource.com/c/go/+/725923 LUCI-TryBot-Result: Go LUCI Reviewed-by: Robert Griesemer Auto-Submit: Robert Griesemer Reviewed-by: Robert Findley --- diff --git a/doc/go_spec.html b/doc/go_spec.html index b129520180..f47f5a6e3e 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -7496,7 +7496,7 @@ returns a received value along with an indication of whether the channel is clos

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. +all types in its type set must be channels. It is an error if any of those channels is a receive-only channel.