mirror of https://github.com/golang/go.git
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 <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>
This commit is contained in:
parent
8ed74ee39a
commit
cc1771e2fd
|
|
@ -26,7 +26,7 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<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 -->
|
||||
|
|
@ -56,6 +56,15 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue