From e2cb60b378e9030dc4e3bf158f54dddcd87295f9 Mon Sep 17 00:00:00 2001
From: Robert Griesemer
Date: Fri, 19 Jun 2009 13:03:01 -0700
Subject: [PATCH] fix for conversion rule
R=rsc
DELTA=25 (10 added, 7 deleted, 8 changed)
OCL=30516
CL=30531
---
doc/go_spec.html | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 9ffcb41a77..37faf1c905 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -997,7 +997,7 @@ A channel provides a mechanism for two concurrently executing functions
to synchronize execution and communicate by passing a value of a
specified element type. The element type must be complete (§Types).
(TODO: is completeness necessary here?)
-A channel value may be nil
.
+A value of channel type may be nil
.
@@ -1161,19 +1161,22 @@ be assigned to otherwise incompatible types:
-
+A value can be assigned to an interface variable if the static
+type of the value implements the interface.
+
+-
The predeclared constant
nil
can be assigned to any
pointer, function, slice, map, channel, or interface variable.
-
-A pointer to an array can be assigned to a slice variable with compatible element type.
+A pointer
p
to an array can be assigned to a slice variable
+v
with compatible element type
+if the type of p
or v
is unnamed.
The slice variable then refers to the original array; the data is not copied.
-
-A value can be assigned to an interface variable if the static
-type of the value implements the interface.
-
--
-A value of bidirectional channel type can be assigned to any channel
-variable of compatible channel value type.
+A bidirectional channel
c
can be assigned to a channel variable
+v
with compatible channel value type
+if the type of c
or v
is unnamed.
@@ -3846,13 +3849,13 @@ The following conversion rules apply:
-
-1) Between two compatible types (§Type identity and compatibility).
-The conversion always succeeds.
+1) The conversion succeeds if the value is assignment-compatible
+to a variable of type T.
-
-2) Between two types that would be compatible if they
-or any of their component types were unnamed (§Type identity and compatibility).
-The conversion always succeeds.
+2) The conversion succeeds if the value would be assignment-compatible
+to a variable of type T if the value type or T or any of their component
+types are unnamed (§Type identity and compatibility).
-
3) Between integer types. If the value is a signed quantity, it is
--
2.48.1