Commit b66df0e9 authored by Robert Griesemer's avatar Robert Griesemer

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
parent c729ed63
...@@ -2513,7 +2513,8 @@ rules apply: ...@@ -2513,7 +2513,8 @@ rules apply:
If <code>a</code> is not a map: If <code>a</code> is not a map:
</p> </p>
<ul> <ul>
<li>the index <code>x</code> must be an integer value; it is <i>in range</i> if <code>0 &lt;= x &lt; 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 &lt;= x &lt; len(a)</code>,
otherwise it is <i>out of range</i></li> otherwise it is <i>out of range</i></li>
<li>a <a href="#Constants">constant</a> index must be non-negative <li>a <a href="#Constants">constant</a> index must be non-negative
and representable by a value of type <code>int</code> 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 ...@@ -5095,7 +5096,7 @@ make(T, n) channel asynchronous channel of type T, buffer size n
<p> <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 A <a href="#Constants">constant</a> size argument must be non-negative and
representable by a value of type <code>int</code>. representable by a value of type <code>int</code>.
If both <code>n</code> and <code>m</code> are provided and are constant, then If both <code>n</code> and <code>m</code> are provided and are constant, then
......
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