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.
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>
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Code-Review | +1 |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
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.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |