From: Robert Griesemer Date: Wed, 23 Sep 2015 00:47:38 +0000 (-0700) Subject: spec: minor adjustment of prose in composite literal section X-Git-Tag: go1.6beta1~992 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c720875b76d1a003cdcde38687ae537dda6a59fa;p=gostls13.git spec: minor adjustment of prose in composite literal section The prose discussing composite literals referred to the composite literal type with 'LiteralType', denoting the literal type's EBNF production explicitly. Changed 'LiteralType' to 'literal type' to remove the literal (no pun intended) connection and instead mean the underlying type. Seems a simpler and more readable change than referring to the underlying type everywhere explicitly. Fixes #12717. Change-Id: I225df95f9ece2664b19068525ea8bda5ca05a44a Reviewed-on: https://go-review.googlesource.com/14851 Reviewed-by: Rob Pike --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 7de0c7b716..6c4eac152d 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -2210,7 +2210,7 @@ math.Sin // denotes the Sin function in package math

Composite literals construct values for structs, arrays, slices, and maps and create a new value each time they are evaluated. -They consist of the type of the value followed by a brace-bound list of elements. +They consist of the type of the literal followed by a brace-bound list of elements. Each element may optionally be preceded by a corresponding key.

@@ -2227,11 +2227,11 @@ Element = Expression | LiteralValue .

-The LiteralType must be a struct, array, slice, or map type +The LiteralType's underlying type must be a struct, array, slice, or map type (the grammar enforces this constraint except when the type is given as a TypeName). The types of the elements and keys must be assignable -to the respective field, element, and key types of the LiteralType; +to the respective field, element, and key types of the literal type; there is no additional conversion. The key is interpreted as a field name for struct literals, an index for array and slice literals, and a key for map literals. @@ -2244,7 +2244,7 @@ constant key value. For struct literals the following rules apply: