From df480036185715432a6e3f740e65bceed26c748f Mon Sep 17 00:00:00 2001
From: "Bryan C. Mills"
Date: Fri, 13 Apr 2018 11:57:13 -0400
Subject: [PATCH] =?utf8?q?spec:=20clarify=20=E2=80=9CConstant=20expression?=
=?utf8?q?s=E2=80=9D=20for=20untyped=20operands?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
This change addresses the grammatical complexity described in
https://groups.google.com/forum/#!topic/golang-dev/RmP-LMC3g58.
Change-Id: Ib292b4ca9c880c7c1c8c992e7c033a0f8f951f2c
Reviewed-on: https://go-review.googlesource.com/106855
Reviewed-by: Robert Griesemer
Reviewed-by: Ian Lance Taylor
Reviewed-by: Rob Pike
---
doc/go_spec.html | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/doc/go_spec.html b/doc/go_spec.html
index dbd2307e29..f1300c105a 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
@@ -4160,11 +4160,6 @@ operands and are evaluated at compile time.
Untyped boolean, numeric, and string constants may be used as operands
wherever it is legal to use an operand of boolean, numeric, or string type,
respectively.
-Except for shift operations, if the operands of a binary operation are
-different kinds of untyped constants, the operation and, for non-boolean operations, the result use
-the kind that appears later in this list: integer, rune, floating-point, complex.
-For example, an untyped integer constant divided by an
-untyped complex constant yields an untyped complex constant.
@@ -4174,9 +4169,17 @@ an untyped boolean constant. If the left operand of a constant
result is an integer constant; otherwise it is a constant of the same
type as the left operand, which must be of
integer type.
-Applying all other operators to untyped constants results in an untyped
-constant of the same kind (that is, a boolean, integer, floating-point,
-complex, or string constant).
+
+
+
+Any other operation on untyped constants results in an untyped constant of the
+same kind; that is, a boolean, integer, floating-point, complex, or string
+constant.
+If the untyped operands of a binary operation (other than a shift) are of
+different kinds, the result is of the operand's kind that appears later in this
+list: integer, rune, floating-point, complex.
+For example, an untyped integer constant divided by an
+untyped complex constant yields an untyped complex constant.
--
2.50.0