diff --git a/doc/go_spec.html b/doc/go_spec.html index 80de0f45a6..ba0a475746 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -2975,12 +2975,12 @@ The following rules apply: If a is not a map:

@@ -3450,18 +3450,20 @@ replaced by its left operand alone.

 var s uint = 33
-var i = 1<<s           // 1 has type int
-var j int32 = 1<<s     // 1 has type int32; j == 0
-var k = uint64(1<<s)   // 1 has type uint64; k == 1<<33
-var m int = 1.0<<s     // 1.0 has type int; m == 0 if ints are 32bits in size
-var n = 1.0<<s == j    // 1.0 has type int32; n == true
-var o = 1<<s == 2<<s   // 1 and 2 have type int; o == true if ints are 32bits in size
-var p = 1<<s == 1<<33  // illegal if ints are 32bits in size: 1 has type int, but 1<<33 overflows int
-var u = 1.0<<s         // illegal: 1.0 has type float64, cannot shift
-var u1 = 1.0<<s != 0   // illegal: 1.0 has type float64, cannot shift
-var u2 = 1<<s != 1.0   // illegal: 1 has type float64, cannot shift
-var v float32 = 1<<s   // illegal: 1 has type float32, cannot shift
-var w int64 = 1.0<<33  // 1.0<<33 is a constant shift expression
+var i = 1<<s                  // 1 has type int
+var j int32 = 1<<s            // 1 has type int32; j == 0
+var k = uint64(1<<s)          // 1 has type uint64; k == 1<<33
+var m int = 1.0<<s            // 1.0 has type int; m == 0 if ints are 32bits in size
+var n = 1.0<<s == j           // 1.0 has type int32; n == true
+var o = 1<<s == 2<<s          // 1 and 2 have type int; o == true if ints are 32bits in size
+var p = 1<<s == 1<<33         // illegal if ints are 32bits in size: 1 has type int, but 1<<33 overflows int
+var u = 1.0<<s                // illegal: 1.0 has type float64, cannot shift
+var u1 = 1.0<<s != 0          // illegal: 1.0 has type float64, cannot shift
+var u2 = 1<<s != 1.0          // illegal: 1 has type float64, cannot shift
+var v float32 = 1<<s          // illegal: 1 has type float32, cannot shift
+var w int64 = 1.0<<33         // 1.0<<33 is a constant shift expression
+var x = a[1.0<<s]             // 1.0 has type int; x == a[0] if ints are 32bits in size
+var a = make([]byte, 1.0<<s)  // 1.0 has type int; len(a) == 0 if ints are 32bits in size
 
@@ -5724,9 +5726,10 @@ make(T, n) channel buffered channel of type T, buffer size n

-The size arguments n and m must be of integer type or untyped. -A constant size argument must be non-negative and -representable by a value of type int. +Each of the size arguments n and m must be of integer type +or an untyped constant. +A constant size argument must be non-negative and representable +by a value of type int; if it is an untyped constant it is given type int. If both n and m are provided and are constant, then n must be no larger than m. If n is negative or larger than m at run time,