]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.18: document method set limitation for method selectors
authorRobert Griesemer <gri@golang.org>
Thu, 24 Feb 2022 23:45:11 +0000 (15:45 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 25 Feb 2022 00:25:34 +0000 (00:25 +0000)
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>
doc/go1.18.html

index bc29ed4afe63bafd4e42d656b7ecf33717a811d8..53e9d9b2589b0690802c5fe471ca7cbb0b7ecf00 100644 (file)
@@ -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,