diff --git a/doc/go_spec.html b/doc/go_spec.html index 861546c9475..18357766d11 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -351,7 +351,7 @@ integer literals.
-String literals represent ideal string values. Ideal strings don't
+String literals represent ideal string values. Ideal strings do not
have a named type but they are compatible with type string
(§Type identity and compatibility).
There are two forms: raw string literals and interpreted string
@@ -1037,7 +1037,7 @@ the zero value for the channel's type. After at least one such zero value has b
received, closed(c)
returns true.
Two types may be identical, compatible, or incompatible. @@ -1215,6 +1215,8 @@ Function values are equal if they refer to the same function.
make
(§Making slices, maps, and channels).
+When comparing two values of channel type, the channel value types
+must be compatible but the channel direction is ignored.
-The operand types in binary operations must be compatible, with the following exceptions: +Comparisons are discussed elsewhere +(§Comparison compatibility). +For other binary operators, the +operand types must be identical +(§Properties of types and values) +unless the operation involves +channels, shifts, or ideal constants.
-/
and %
).+In a channel send, the first operand is always a channel and the +second is a value of the channel's element type. +
-
+Except for shift operations,
+if one operand has ideal type and the other operand does not,
+the ideal operand is converted converted to match the type of
+the other operand (§Expressions).
+If both operands are ideal numbers and one is an
+ideal float, the other is converted to ideal float
+(relevant for /
and %
).
+
+The right operand in a shift operation must have unsigned integer type +or be an ideal number that can be converted to unsigned integer type +(§Arithmetic operators). +
-+If the left operand of a non-constant shift operation is an ideal number, +the type of the ideal number +is what it would be if the shift operation were replaced by the 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 u = uint64(1<<s); // 1 has type uint64; u == 1<<33 +var f = float(1<<s); // illegal: 1 has type float, cannot shift +var g = float(1<<33); // legal; 1<<33 is a constant shift operation; g == 1<<33 +
Unary operators have the highest precedence.