Commit 60a6ae8c authored by Robert Griesemer's avatar Robert Griesemer

spec: permit trailing comma in conversions

Also: Adjust prose in Conversions section
to be consistent.

This is a backward-compatible syntax change.
For a discussion see issue 2568.

Fixes #2568.
Fixes #4123.

R=golang-dev, r, iant, rsc
CC=golang-dev
https://golang.org/cl/6572049
parent 3c9eb5b4
<!--{
"Title": "The Go Programming Language Specification",
"Subtitle": "Version of September 22, 2012",
"Subtitle": "Version of September 26, 2012",
"Path": "/ref/spec"
}-->
......@@ -3390,7 +3390,7 @@ that can be converted to type <code>T</code>.
</p>
<pre class="ebnf">
Conversion = Type "(" Expression ")" .
Conversion = Type "(" Expression [ "," ] ")" .
</pre>
<p>
......@@ -3464,12 +3464,11 @@ in any of these cases:
<code>x</code>'s type and <code>T</code> are both complex types.
</li>
<li>
<code>x</code> is an integer or has type <code>[]byte</code> or
<code>[]rune</code> and <code>T</code> is a string type.
<code>x</code> is an integer or a slice of bytes or runes
and <code>T</code> is a string type.
</li>
<li>
<code>x</code> is a string and <code>T</code> is <code>[]byte</code> or
<code>[]rune</code>.
<code>x</code> is a string and <code>T</code> is a slice of bytes or runes.
</li>
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment