mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
doc/go1.18: document method set limitation for method selectors
For #51183. For #47694. Change-Id: If47ae074c3cd9f73b2e7f6408749d9a7d56bd8d2 Reviewed-on: https://go-review.googlesource.com/c/go/+/387924 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
c0840a7c72
commit
b8b3196375
|
@ -135,6 +135,16 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
the predeclared functions <code>real</code>, <code>imag</code>, and <code>complex</code>.
|
||||
We hope to remove this restriction in Go 1.19.
|
||||
</li>
|
||||
<li><!-- https://golang.org/issue/51183 -->
|
||||
The Go compiler currently only supports calling a method <code>m</code> on a value
|
||||
<code>x</code> of type parameter type <code>P</code> if <code>m</code> is explictly
|
||||
declared by <code>P</code>'s constraint interface.
|
||||
Similarly, method values <code>x.m</code> and method expressions
|
||||
<code>P.m</code> also are only supported if <code>m</code> is explicitly
|
||||
declared by <code>P</code>, even though <code>m</code> might be in the method set
|
||||
of <code>P</code> by virtue of the fact that all types in <code>P</code> implement
|
||||
<code>m</code>. We hope to remove this restriction in Go 1.19.
|
||||
</li>
|
||||
<li><!-- https://golang.org/issue/49030 -->
|
||||
Embedding a type parameter, or a pointer to a type parameter, as
|
||||
an unnamed field in a struct type is not permitted. Similarly,
|
||||
|
|
Loading…
Reference in a new issue