]> Cypherpunks repositories - gostls13.git/commit
spec: remove restriction on channel element types for close built-in (bug fix)
authorRobert Griesemer <gri@google.com>
Tue, 2 Dec 2025 22:32:13 +0000 (14:32 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 2 Dec 2025 23:07:19 +0000 (15:07 -0800)
commit1a64db3a4b3fc328f945d8271c0b98923526255d
tree7cef5ce344df66ae7859faad6f86c96f738c98f1
parent2e06fa6b68bf5fff7f2dd1ba55dba6fc1d206ebf
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>
doc/go_spec.html