Skip to content

Commit cc1771e

Browse files
griesemerRobert Griesemer
authored and
Robert Griesemer
committed
doc/go1.20: document new semantics for comparable constraint
For #54202. For #56548. Change-Id: If2b9e41813c3e1c8d373469a40e1bd0bd5ea2b16 Reviewed-on: https://go-review.googlesource.com/c/go/+/454595 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Bypass: Robert Griesemer <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
1 parent 8ed74ee commit cc1771e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

doc/go1.20.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h2 id="introduction">DRAFT RELEASE NOTES — Introduction to Go 1.20</h2>
2626
<h2 id="language">Changes to the language</h2>
2727

2828
<p>
29-
Go 1.20 includes three changes to the language.
29+
Go 1.20 includes four changes to the language.
3030
</p>
3131

3232
<p><!-- https://go.dev/issue/46505 -->
@@ -56,6 +56,15 @@ <h2 id="language">Changes to the language</h2>
5656
what the implementations have always done.
5757
</p>
5858

59+
<p><!-- https://go.dev/issue/56548 -->
60+
<a href="/ref/spec#Comparison_operators">Comparable types</a> (such as ordinary interfaces)
61+
may now satisfy <code>comparable</code> constraints, even if the type arguments
62+
are not strictly comparable (comparison may panic at runtime).
63+
This makes it possible to instantiate a type parameter constrained by <code>comparable</code>
64+
(e.g., a type parameter for a user-defined generic map key) with a non-strictly comparable type argument
65+
such as an interface type, or a composite type containing an interface type.
66+
</p>
67+
5968
<h2 id="ports">Ports</h2>
6069

6170
<h3 id="freebsd-riscv">FreeBSD/RISC-V</h3>

0 commit comments

Comments
 (0)