Skip to content

Commit

Permalink
doc/go1.20: document new semantics for comparable constraint
Browse files Browse the repository at this point in the history
For #54202.
For #56548.

Change-Id: If2b9e41813c3e1c8d373469a40e1bd0bd5ea2b16
Reviewed-on: https://go-review.googlesource.com/c/go/+/454595
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
  • Loading branch information
griesemer authored and Robert Griesemer committed Dec 1, 2022
1 parent 8ed74ee commit cc1771e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion doc/go1.20.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2 id="introduction">DRAFT RELEASE NOTES — Introduction to Go 1.20</h2>
<h2 id="language">Changes to the language</h2>

<p>
Go 1.20 includes three changes to the language.
Go 1.20 includes four changes to the language.
</p>

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

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

<h2 id="ports">Ports</h2>

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

0 comments on commit cc1771e

Please sign in to comment.