From: Rob Pike Date: Tue, 21 Jul 2015 04:05:13 +0000 (+1000) Subject: doc: add a clause about embedded methods to go1compat X-Git-Tag: go1.5beta3~128 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6c7acdfbdbfd5c8a3b60d6b796041257360a19c3;p=gostls13.git doc: add a clause about embedded methods to go1compat 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 Reviewed-by: Russ Cox --- diff --git a/doc/go1compat.html b/doc/go1compat.html index d800dec0c0..607d354687 100644 --- a/doc/go1compat.html +++ b/doc/go1compat.html @@ -95,6 +95,18 @@ We therefore recommend that composite literals whose type is defined in a separate package should use the keyed notation. +
  • +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. +
  • +
  • Dot imports. If a program imports a standard package using import . "path", additional names defined in the