From 8268eadb9ee2a36e117c55296bbfdcf38566b641 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 9 Jul 2013 21:12:53 -0700 Subject: [PATCH] spec: define notion of named type The notion of a named type is crucial for the definition of type identity, assignability, definitions of methods. Explicitly introduce the notion with an extra sentence. Fixes #5682. R=r, rsc, iant CC=golang-dev https://golang.org/cl/11055043 --- doc/go_spec.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index a1dc7d8b19..4f2995ab20 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -640,10 +640,10 @@ expressions.

A type determines the set of values and operations specific to values of that -type. A type may be specified by a -(possibly qualified) -type name or a type literal, -which composes a new type from previously declared types. +type. Types may be named or unnamed. Named types are specified +by a (possibly qualified) +type name; unnamed types are specified +using a type literal, which composes a new type from existing types.

@@ -1358,9 +1358,9 @@ Two types are either identical or different.
 

-Two named types are identical if their type names originate in the same +Two named types are identical if their type names originate in the same TypeSpec. -A named and an unnamed type are always different. Two unnamed types are identical +A named and an unnamed type are always different. Two unnamed types are identical if the corresponding type literals are identical, that is, if they have the same literal structure and corresponding components have identical types. In detail:

@@ -1442,7 +1442,7 @@ A value x is assignable to a variable of type T
  • x's type V and T have identical underlying types and at least one of V -or T is not a named type. +or T is not a named type.
  • T is an interface type and -- 2.48.1