Commit 507051d6 authored by Robert Griesemer's avatar Robert Griesemer

spec: complete list of special comma-ok forms

The enumerations didn't include the syntactic form where the lhs is
full variable declaration with type specification, as in:

var x, ok T = ...

Fixes #15782.

Change-Id: I0f7bafc37dc9dcf62cdb0894a0d157074ccd4b3e
Reviewed-on: https://go-review.googlesource.com/27670Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: default avatarRob Pike <r@golang.org>
parent 78bc418f
<!--{ <!--{
"Title": "The Go Programming Language Specification", "Title": "The Go Programming Language Specification",
"Subtitle": "Version of May 31, 2016", "Subtitle": "Version of August 24, 2016",
"Path": "/ref/spec" "Path": "/ref/spec"
}--> }-->
...@@ -2933,6 +2933,7 @@ used in an <a href="#Assignments">assignment</a> or initialization of the specia ...@@ -2933,6 +2933,7 @@ used in an <a href="#Assignments">assignment</a> or initialization of the specia
v, ok = a[x] v, ok = a[x]
v, ok := a[x] v, ok := a[x]
var v, ok = a[x] var v, ok = a[x]
var v, ok T = a[x]
</pre> </pre>
<p> <p>
...@@ -3130,6 +3131,7 @@ A type assertion used in an <a href="#Assignments">assignment</a> or initializat ...@@ -3130,6 +3131,7 @@ A type assertion used in an <a href="#Assignments">assignment</a> or initializat
v, ok = x.(T) v, ok = x.(T)
v, ok := x.(T) v, ok := x.(T)
var v, ok = x.(T) var v, ok = x.(T)
var v, ok T1 = x.(T)
</pre> </pre>
<p> <p>
...@@ -3737,6 +3739,7 @@ A receive expression used in an <a href="#Assignments">assignment</a> or initial ...@@ -3737,6 +3739,7 @@ A receive expression used in an <a href="#Assignments">assignment</a> or initial
x, ok = &lt;-ch x, ok = &lt;-ch
x, ok := &lt;-ch x, ok := &lt;-ch
var x, ok = &lt;-ch var x, ok = &lt;-ch
var x, ok T = &lt;-ch
</pre> </pre>
<p> <p>
......
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