Skip to content

Commit 9b49ac0

Browse files
committed
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 <[email protected]>
1 parent cafb36b commit 9b49ac0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

doc/go_spec.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--{
22
"Title": "The Go Programming Language Specification",
3-
"Subtitle": "Version of January 17, 2018",
3+
"Subtitle": "Version of January 23, 2018",
44
"Path": "/ref/spec"
55
}-->
66

@@ -694,9 +694,8 @@ <h2 id="Types">Types</h2>
694694
</pre>
695695

696696
<p>
697-
Named instances of the boolean, numeric, and string types are
698-
<a href="#Predeclared_identifiers">predeclared</a>.
699-
Other named types are introduced with <a href="#Type_declarations">type declarations</a>.
697+
The language <a href="#Predeclared_identifiers">predeclares</a> certain type names.
698+
Others are introduced with <a href="#Type_declarations">type declarations</a>.
700699
<i>Composite types</i>&mdash;array, struct, pointer, function,
701700
interface, slice, map, and channel types&mdash;may be constructed using
702701
type literals.
@@ -1025,8 +1024,8 @@ <h3 id="Struct_types">Struct types</h3>
10251024
</p>
10261025

10271026
<p>
1028-
Given a struct type <code>S</code> and a type named <code>T</code>,
1029-
promoted methods are included in the method set of the struct as follows:
1027+
Given a struct type <code>S</code> and a <a href="#Type_definitions">defined type</a>
1028+
<code>T</code>, promoted methods are included in the method set of the struct as follows:
10301029
</p>
10311030
<ul>
10321031
<li>
@@ -2643,8 +2642,8 @@ <h3 id="Selectors">Selectors</h3>
26432642
</li>
26442643

26452644
<li>
2646-
As an exception, if the type of <code>x</code> is a named pointer type
2647-
and <code>(*x).f</code> is a valid selector expression denoting a field
2645+
As an exception, if the type of <code>x</code> is a <a href="#Type_definitions">defined</a>
2646+
pointer type and <code>(*x).f</code> is a valid selector expression denoting a field
26482647
(but not a method), <code>x.f</code> is shorthand for <code>(*x).f</code>.
26492648
</li>
26502649

0 commit comments

Comments
 (0)