From cc1771e2fd0fbf02079f76a21b3548d6988296b0 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 1 Dec 2022 12:36:51 -0800 Subject: [PATCH] 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 Reviewed-by: Ian Lance Taylor TryBot-Bypass: Robert Griesemer Reviewed-by: Robert Griesemer --- doc/go1.20.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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.

Changes to the language

- Go 1.20 includes three changes to the language. + Go 1.20 includes four changes to the language.

@@ -56,6 +56,15 @@ Do not send CLs removing the interior tags from such phrases. what the implementations have always done.

+

+ Comparable types (such as ordinary interfaces) + may now satisfy comparable 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 comparable + (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. +

+

Ports

FreeBSD/RISC-V

-- 2.50.0