From 4a2391e7c965f7ed4d1ec189087293c1f6bae43c Mon Sep 17 00:00:00 2001 From: griesemer Date: Tue, 19 Sep 2017 14:35:15 +0200 Subject: [PATCH] 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 --- doc/go_spec.html | 13 ++++++++----- 1 file 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 @@ @@ -761,7 +761,8 @@ using a receiver of that type.

A boolean type represents the set of Boolean truth values denoted by the predeclared constants true -and false. The predeclared boolean type is bool. +and false. The predeclared boolean type is bool; +it is a defined type.

Numeric types

@@ -808,8 +809,9 @@ uintptr an unsigned integer large enough to store the uninterpreted bits of a p

-To avoid portability issues all numeric types are distinct except -byte, which is an alias for uint8, and +To avoid portability issues all numeric types are defined +types and thus distinct except +byte, which is an alias for uint8, and rune, which is an alias for int32. Conversions are required when different numeric types are mixed in an expression @@ -825,7 +827,8 @@ A string type 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 string. +The predeclared string type is string; +it is a defined type.

-- 2.48.1