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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Robert Griesemer 2025-12-02 14:32:13 -08:00 committed by Gopher Robot
parent 2e06fa6b68
commit 1a64db3a4b

View file

@ -7496,7 +7496,7 @@ returns a received value along with an indication of whether the channel is clos
<p> <p>
If the type of the argument to <code>close</code> is a If the type of the argument to <code>close</code> is a
<a href="#Type_parameter_declarations">type parameter</a>, <a href="#Type_parameter_declarations">type parameter</a>,
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. It is an error if any of those channels is a receive-only channel.
</p> </p>