Commit 6c7acdfb authored by Rob Pike's avatar Rob Pike

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/12460Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
parent fc7f6d30
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment