Commit f8555ea6 authored by Robert Griesemer's avatar Robert Griesemer

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/27356Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent d24f446a
<!--{ <!--{
"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 } . ...@@ -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.
......
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