[go] spec: remove restriction on channel element types for close built-in (bug fix)

3 views
Skip to first unread message

Robert Griesemer (Gerrit)

unread,
Dec 2, 2025, 5:41:51 PM (10 hours ago) Dec 2
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Robert Griesemer has uploaded the change for review

Commit message

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

Change diff

diff --git a/doc/go_spec.html b/doc/go_spec.html
index b129520..f47f5a6 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -7496,7 +7496,7 @@
<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>

Change information

Files:
  • M doc/go_spec.html
Change size: XS
Delta: 1 file changed, 1 insertion(+), 1 deletion(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: If65d50bfb581b7f37999413088d3d3b1820e054a
Gerrit-Change-Number: 725923
Gerrit-PatchSet: 1
Gerrit-Owner: Robert Griesemer <g...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Dec 2, 2025, 5:45:57 PM (10 hours ago) Dec 2
to goph...@pubsubhelper.golang.org, Alan Donovan, Robert Findley, Ian Lance Taylor, Keith Randall, golang-co...@googlegroups.com
Attention needed from Alan Donovan, Ian Lance Taylor and Robert Findley

Robert Griesemer voted

Auto-Submit+1
Code-Review+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alan Donovan
  • Ian Lance Taylor
  • Robert Findley
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: If65d50bfb581b7f37999413088d3d3b1820e054a
Gerrit-Change-Number: 725923
Gerrit-PatchSet: 1
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Robert Findley <rfin...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-CC: Keith Randall <k...@golang.org>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Alan Donovan <adon...@google.com>
Gerrit-Attention: Robert Findley <rfin...@google.com>
Gerrit-Comment-Date: Tue, 02 Dec 2025 22:45:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Findley (Gerrit)

unread,
Dec 2, 2025, 5:48:18 PM (10 hours ago) Dec 2
to Robert Griesemer, goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, Ian Lance Taylor, Keith Randall, golang-co...@googlegroups.com
Attention needed from Alan Donovan, Ian Lance Taylor and Robert Griesemer

Robert Findley voted Code-Review+2

Code-Review+2
Open in Gerrit

Related details

Attention is currently required from:
  • Alan Donovan
  • Ian Lance Taylor
  • Robert Griesemer
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: If65d50bfb581b7f37999413088d3d3b1820e054a
Gerrit-Change-Number: 725923
Gerrit-PatchSet: 1
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Robert Findley <rfin...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-CC: Keith Randall <k...@golang.org>
Gerrit-Attention: Robert Griesemer <g...@google.com>
Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
Gerrit-Attention: Alan Donovan <adon...@google.com>
Gerrit-Comment-Date: Tue, 02 Dec 2025 22:48:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Gopher Robot (Gerrit)

unread,
Dec 2, 2025, 6:07:25 PM (10 hours ago) Dec 2
to Robert Griesemer, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go LUCI, Robert Findley, Alan Donovan, Ian Lance Taylor, Keith Randall, golang-co...@googlegroups.com

Gopher Robot submitted the change

Change information

Commit message:
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-by: Robert Griesemer <g...@google.com>
Auto-Submit: Robert Griesemer <g...@google.com>
Reviewed-by: Robert Findley <rfin...@google.com>
Files:
  • M doc/go_spec.html
Change size: XS
Delta: 1 file changed, 1 insertion(+), 1 deletion(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Robert Findley, +1 by Robert Griesemer
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: If65d50bfb581b7f37999413088d3d3b1820e054a
Gerrit-Change-Number: 725923
Gerrit-PatchSet: 2
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Robert Findley <rfin...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-CC: Keith Randall <k...@golang.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages