mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
2e06fa6b68
commit
1a64db3a4b
1 changed files with 1 additions and 1 deletions
|
|
@ -7496,7 +7496,7 @@ returns a received value along with an indication of whether the channel is clos
|
|||
<p>
|
||||
If the type of the argument to <code>close</code> is 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.
|
||||
</p>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue