]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.18: document behavior of go/types predicates for extended interfaces
authorRobert Griesemer <gri@golang.org>
Tue, 8 Feb 2022 04:59:59 +0000 (20:59 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 9 Feb 2022 05:39:47 +0000 (05:39 +0000)
For #47694.

Change-Id: Ic27193b65ef4b3c0c932107b8731b5f8d3190ad5
Reviewed-on: https://go-review.googlesource.com/c/go/+/383918
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
doc/go1.18.html

index ed32a93bc32732dad218d234171478bf3c979526..1a68482ad61f63d80d75ebbfeb9a904c16c8d986 100644 (file)
@@ -909,6 +909,19 @@ Do not send CLs removing the interior tags from such phrases.
         field.
       </li>
     </ul>
+    <p>
+      The predicates
+      <a href="/pkg/go/types/#AssignableTo"><code>AssignableTo</code></a>,
+      <a href="/pkg/go/types/#ConvertibleTo"><code>ConvertibleTo</code></a>,
+      <a href="/pkg/go/types/#Implements"><code>Implements</code></a>,
+      <a href="/pkg/go/types/#Identical"><code>Identical</code></a>,
+      <a href="/pkg/go/types/#IdenticalIgnoreTags"><code>IdenticalIgnoreTags</code></a>, and
+      <a href="/pkg/go/types/#AssertableTo"><code>AssertableTo</code></a>
+      now also work with arguments that are or contain generalized interfaces, i.e. interfaces
+      that may only be used as type constraints in Go code.
+      Note that the behavior of <code>AssertableTo</code> is undefined if the first argument
+      is a generalized interface.
+    </p>
   </dd>
 </dl>