aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2018-01-22 16:20:01 -0800
committerRobert Griesemer <gri@golang.org>2018-01-23 17:39:18 +0000
commit9b49ac0366d3e3948adf5a30bfcff52049e1799a (patch)
tree4c6e85ea34ef26449eb8ac0ea25451eab6e5d2ae
parentcafb36bf11c0ec30a5650a6f1200b0f046fc67a7 (diff)
downloadgo-9b49ac0366d3e3948adf5a30bfcff52049e1799a.tar.gz
go-9b49ac0366d3e3948adf5a30bfcff52049e1799a.zip
spec: consistently use "defined type" and "type name" (cleanup)
When we introduced the notion of alias type declarations, we renamed "named type" to "defined type" to avoid confusion with types denoted by aliases and thus are also types with names, or "named types". Some of the old uses of "named types" remained; this change removes them. Now the spec consistently uses the terms: - "defined type" for a type declared via a type definition - "type name" for any name denoting an (alias or defined) type - "alias" for a type name declared in an alias declaration New prose is encouraged to avoid the term "named type" to counter- act further confusion. Fixes #23474. Change-Id: I5fb59f1208baf958da79cf51ed3eb1411cd18e03 Reviewed-on: https://go-review.googlesource.com/89115 Reviewed-by: Rob Pike <r@golang.org>
-rw-r--r--doc/go_spec.html15
1 files changed, 7 insertions, 8 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 1ada626bf0..33b66cb905 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
- "Subtitle": "Version of January 17, 2018",
+ "Subtitle": "Version of January 23, 2018",
"Path": "/ref/spec"
}-->
@@ -694,9 +694,8 @@ TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType
</pre>
<p>
-Named instances of the boolean, numeric, and string types are
-<a href="#Predeclared_identifiers">predeclared</a>.
-Other named types are introduced with <a href="#Type_declarations">type declarations</a>.
+The language <a href="#Predeclared_identifiers">predeclares</a> certain type names.
+Others are introduced with <a href="#Type_declarations">type declarations</a>.
<i>Composite types</i>&mdash;array, struct, pointer, function,
interface, slice, map, and channel types&mdash;may be constructed using
type literals.
@@ -1025,8 +1024,8 @@ of a struct except that they cannot be used as field names in
</p>
<p>
-Given a struct type <code>S</code> and a type named <code>T</code>,
-promoted methods are included in the method set of the struct as follows:
+Given a struct type <code>S</code> and a <a href="#Type_definitions">defined type</a>
+<code>T</code>, promoted methods are included in the method set of the struct as follows:
</p>
<ul>
<li>
@@ -2643,8 +2642,8 @@ expression is illegal.
</li>
<li>
-As an exception, if the type of <code>x</code> is a named pointer type
-and <code>(*x).f</code> is a valid selector expression denoting a field
+As an exception, if the type of <code>x</code> is a <a href="#Type_definitions">defined</a>
+pointer type and <code>(*x).f</code> is a valid selector expression denoting a field
(but not a method), <code>x.f</code> is shorthand for <code>(*x).f</code>.
</li>