mirror of https://github.com/golang/go.git
spec: refine the wording about variables in type switches
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5686064
This commit is contained in:
parent
d1e1367cad
commit
818e3cdb09
|
|
@ -1,6 +1,6 @@
|
||||||
<!--{
|
<!--{
|
||||||
"Title": "The Go Programming Language Specification",
|
"Title": "The Go Programming Language Specification",
|
||||||
"Subtitle": "Version of February 21, 2012"
|
"Subtitle": "Version of February 22, 2012"
|
||||||
}-->
|
}-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
@ -4023,7 +4023,8 @@ TypeList = Type { "," Type } .
|
||||||
<p>
|
<p>
|
||||||
The TypeSwitchGuard may include a
|
The TypeSwitchGuard may include a
|
||||||
<a href="#Short_variable_declarations">short variable declaration</a>.
|
<a href="#Short_variable_declarations">short variable declaration</a>.
|
||||||
When that form is used, the variable is declared in each clause.
|
When that form is used, the variable is declared at the beginning of
|
||||||
|
the <a href="#Blocks">implicit block</a> in each clause.
|
||||||
In clauses with a case listing exactly one type, the variable
|
In clauses with a case listing exactly one type, the variable
|
||||||
has that type; otherwise, the variable has the type of the expression
|
has that type; otherwise, the variable has the type of the expression
|
||||||
in the TypeSwitchGuard.
|
in the TypeSwitchGuard.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue