]> Cypherpunks repositories - gostls13.git/commitdiff
spec: typed indices must be of integer type
authorRobert Griesemer <gri@golang.org>
Mon, 11 Mar 2013 16:20:52 +0000 (09:20 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 11 Mar 2013 16:20:52 +0000 (09:20 -0700)
The same rules apply for make arguments.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/7656043

doc/go_spec.html

index 992c4718a5c9d97f5b7da44abf3d0b413ea15078..53f079a2f74d05f488a69493a014bf6cf0f1ca5b 100644 (file)
@@ -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 &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>
        <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