diff options
author | Robert Griesemer <gri@golang.org> | 2022-12-01 12:36:51 -0800 |
---|---|---|
committer | Robert Griesemer <gri@google.com> | 2022-12-01 20:58:25 +0000 |
commit | cc1771e2fd0fbf02079f76a21b3548d6988296b0 (patch) | |
tree | 97b85391a640fb9a89441f48dfa733cd43cf2c31 /doc | |
parent | 8ed74ee39afab11012460fa3e54dd6b83a6439c0 (diff) | |
download | go-git-cc1771e2fd0fbf02079f76a21b3548d6988296b0.tar.gz |
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>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/go1.20.html | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/go1.20.html b/doc/go1.20.html index 571c466134..ab09effaff 100644 --- a/doc/go1.20.html +++ b/doc/go1.20.html @@ -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> |