aboutsummaryrefslogtreecommitdiff
path: root/doc/go_spec.html
diff options
context:
space:
mode:
authorgriesemer <gri@golang.org>2017-09-19 14:35:15 +0200
committerRobert Griesemer <gri@golang.org>2017-09-19 14:33:25 +0000
commit4a2391e7c965f7ed4d1ec189087293c1f6bae43c (patch)
tree144d13dfbf673c208f2c6a7a284efd44f65e021b /doc/go_spec.html
parent3dd96e9d82c59755117fd259a836a55098507001 (diff)
downloadgo-4a2391e7c965f7ed4d1ec189087293c1f6bae43c.tar.gz
go-4a2391e7c965f7ed4d1ec189087293c1f6bae43c.zip
spec: state which predeclared types are defined or alias types (clarification)
When we introduced the distinction between "defined" and "alias" types we retained the notion of a "named" type (any type with a name). The predeclared types (which all have names) simply remained named types. This CL clarifies the spec by stating excplicitly which predeclared types are defined types (or at least "act" like defined types), and which ones are alias types. Fixes #21785. Change-Id: Ia8ae133509eb5d738e6757b3442c9992355e3535 Reviewed-on: https://go-review.googlesource.com/64591 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'doc/go_spec.html')
-rw-r--r--doc/go_spec.html13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html
index ba0a475746..9962fa1c41 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
- "Subtitle": "Version of September 1, 2017",
+ "Subtitle": "Version of September 19, 2017",
"Path": "/ref/spec"
}-->
@@ -761,7 +761,8 @@ using a receiver of that type.
<p>
A <i>boolean type</i> represents the set of Boolean truth values
denoted by the predeclared constants <code>true</code>
-and <code>false</code>. The predeclared boolean type is <code>bool</code>.
+and <code>false</code>. The predeclared boolean type is <code>bool</code>;
+it is a <a href="#Type_definitions">defined type</a>.
</p>
<h3 id="Numeric_types">Numeric types</h3>
@@ -808,8 +809,9 @@ uintptr an unsigned integer large enough to store the uninterpreted bits of a p
</pre>
<p>
-To avoid portability issues all numeric types are distinct except
-<code>byte</code>, which is an alias for <code>uint8</code>, and
+To avoid portability issues all numeric types are <a href="#Type_definitions">defined
+types</a> and thus distinct except
+<code>byte</code>, which is an <a href="#Alias_declarations">alias</a> for <code>uint8</code>, and
<code>rune</code>, which is an alias for <code>int32</code>.
Conversions
are required when different numeric types are mixed in an expression
@@ -825,7 +827,8 @@ A <i>string type</i> represents the set of string values.
A string value is a (possibly empty) sequence of bytes.
Strings are immutable: once created,
it is impossible to change the contents of a string.
-The predeclared string type is <code>string</code>.
+The predeclared string type is <code>string</code>;
+it is a <a href="#Type_definitions">defined type</a>.
</p>
<p>