diff --git a/doc/go_spec.html b/doc/go_spec.html index ff7ce325ca..8b2d515df0 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1120,9 +1120,10 @@ they implement the Lock interface as well as the File interface.

-An interface may contain an interface type name T +An interface may use an interface type name T in place of a method specification. -The effect is equivalent to enumerating the methods of T explicitly +The effect, called embedding an interface, +is equivalent to enumerating the methods of T explicitly in the interface.

@@ -1139,6 +1140,26 @@ type File interface { } +

+An interface definition for type T may not embed itself, +nor any interface type that embeds T directly or indirectly. +

+ +
+// illegal: Bad cannot embed itself
+type Bad interface {
+	Bad
+}
+
+// illegal: Bad1 cannot embed itself using Bad2
+type Bad1 interface {
+	Bad2
+}
+type Bad2 interface {
+	Bad1
+}
+
+

Map types