mirror of
https://github.com/golang/go
synced 2024-11-26 20:21:25 -07:00
spec: update language on type switches to match implementations
See the issue below for details. Fixes #16794. Change-Id: I7e338089fd80ddcb634fa80bfc658dee2772361c Reviewed-on: https://go-review.googlesource.com/27356 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
d24f446a90
commit
f8555ea6fd
@ -1,6 +1,6 @@
|
|||||||
<!--{
|
<!--{
|
||||||
"Title": "The Go Programming Language Specification",
|
"Title": "The Go Programming Language Specification",
|
||||||
"Subtitle": "Version of August 26, 2016",
|
"Subtitle": "Version of September 1, 2016",
|
||||||
"Path": "/ref/spec"
|
"Path": "/ref/spec"
|
||||||
}-->
|
}-->
|
||||||
|
|
||||||
@ -4690,8 +4690,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 at the beginning of
|
When that form is used, the variable is declared at the end of the
|
||||||
the <a href="#Blocks">implicit block</a> in each clause.
|
TypeSwitchCase in the <a href="#Blocks">implicit block</a> of 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
Block a user