doc/go1.18: document behavior of go/types predicates for extended interfaces

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>
This commit is contained in:
Robert Griesemer 2022-02-07 20:59:59 -08:00
parent e4ca3fa345
commit 255acb0c05

View 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>