From 735e00d4a0b3775ea087b9ebbe8f136749fe6896 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 31 Mar 2010 16:37:22 -0700 Subject: [PATCH] go spec: clarification of type declarations R=r, rsc CC=golang-dev https://golang.org/cl/849044 --- doc/go_spec.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 84480f6e8a9..4a4fa5023d6 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1704,9 +1704,11 @@ last non-empty expression list.

A type declaration binds an identifier, the type name, to a new type that has the same definition (element, fields, channel direction, etc.) as -an existing type. The new type is +an existing type. With the exception of interface types, the new type is compatible with, but different from, the existing type. +A newly defined interface type is always +identical to the existing type.

@@ -1737,7 +1739,7 @@ type Cipher interface {
 

The declared type does not inherit any methods bound to the existing type, but the method set -of elements of a composite type is not changed: +of elements of a composite type or of an interface type is not changed:

@@ -1754,6 +1756,10 @@ type NewMutex Mutex
 type PrintableMutex struct {
 	Mutex
 }
+
+// MyCipher is an interface type that has the same method set as Cipher;
+// it is indistinguishable from Cipher.
+type MyCipher Cipher