mirror of
https://github.com/golang/go
synced 2024-11-25 07:07:57 -07:00
spec: typed indices must be of integer type
The same rules apply for make arguments. R=r, rsc, iant, ken CC=golang-dev https://golang.org/cl/7656043
This commit is contained in:
parent
c729ed631f
commit
b66df0e9ba
@ -2513,7 +2513,8 @@ rules apply:
|
||||
If <code>a</code> is not a map:
|
||||
</p>
|
||||
<ul>
|
||||
<li>the index <code>x</code> must be an integer value; it is <i>in range</i> if <code>0 <= x < len(a)</code>,
|
||||
<li>the index <code>x</code> must be of integer type or untyped;
|
||||
it is <i>in range</i> if <code>0 <= x < len(a)</code>,
|
||||
otherwise it is <i>out of range</i></li>
|
||||
<li>a <a href="#Constants">constant</a> index must be non-negative
|
||||
and representable by a value of type <code>int</code>
|
||||
@ -5095,7 +5096,7 @@ make(T, n) channel asynchronous channel of type T, buffer size n
|
||||
|
||||
|
||||
<p>
|
||||
The size arguments <code>n</code> and <code>m</code> must be integer values.
|
||||
The size arguments <code>n</code> and <code>m</code> must be of integer type or untyped.
|
||||
A <a href="#Constants">constant</a> size argument must be non-negative and
|
||||
representable by a value of type <code>int</code>.
|
||||
If both <code>n</code> and <code>m</code> are provided and are constant, then
|
||||
|
Loading…
Reference in New Issue
Block a user