]> Cypherpunks.ru repositories - gostls13.git/commitdiff
doc: add a clause about embedded methods to go1compat
authorRob Pike <r@golang.org>
Tue, 21 Jul 2015 04:05:13 +0000 (14:05 +1000)
committerRob Pike <r@golang.org>
Wed, 22 Jul 2015 01:25:32 +0000 (01:25 +0000)
This is a corner case but it is suggested we call it out.

Fixes #11798.

Change-Id: I2ddb5b363cd2921666dbf03bbf98107697ca40e5
Reviewed-on: https://go-review.googlesource.com/12460
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
doc/go1compat.html

index d800dec0c0dec106338ae0d578b82fea7ce8f99d..607d35468764c3c356b1a63e887426718d8085b7 100644 (file)
@@ -95,6 +95,18 @@ We therefore recommend that composite literals whose type is defined
 in a separate package should use the keyed notation.
 </li>
 
+<li>
+Methods. As with struct fields, it may be necessary to add methods
+to types.
+Under some circumstances, such as when the type is embedded in
+a struct along with another type,
+the addition of the new method may break
+the struct by creating a conflict with an existing method of the other
+embedded type.
+We cannot protect against this rare case and do not guarantee compatibility
+should it arise.
+</li>
+
 <li>
 Dot imports. If a program imports a standard package
 using <code>import . "path"</code>, additional names defined in the