1
0
mirror of https://github.com/golang/go synced 2024-11-21 19:14:44 -07:00

go spec: fix and clarify syntax of conversions

Fixes #803.

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/1281041
This commit is contained in:
Robert Griesemer 2010-05-24 14:58:26 -07:00
parent 1d6eb74697
commit 934a520d75

View File

@ -1,5 +1,5 @@
<!-- title The Go Programming Language Specification -->
<!-- subtitle Version of May 14, 2010 -->
<!-- subtitle Version of May 24, 2010 -->
<!--
Todo
@ -3254,7 +3254,18 @@ that can be converted to type <code>T</code>.
</p>
<pre class="ebnf">
Conversion = LiteralType "(" Expression ")" .
Conversion = Type "(" Expression ")" .
</pre>
<p>
If the type starts with an operator it must be parenthesized:
</p>
<pre>
*Point(p) // same as *(Point(p))
(*Point)(p) // p is converted to (*Point)
&lt;-chan int(c) // same as &lt;-(chan int(c))
(&lt;-chan int)(c) // c is converted to (&lt;-chan int)
</pre>
<p>