Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
e2cb60b3
Commit
e2cb60b3
authored
Jun 19, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for conversion rule
R=rsc DELTA=25 (10 added, 7 deleted, 8 changed) OCL=30516 CL=30531
parent
a6c7a80b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
doc/go_spec.html
doc/go_spec.html
+16
-13
No files found.
doc/go_spec.html
View file @
e2cb60b3
...
...
@@ -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 valu
e may be
<code>
nil
</code>
.
A
value of channel typ
e may be
<code>
nil
</code>
.
</p>
<pre
class=
"grammar"
>
...
...
@@ -1161,19 +1161,22 @@ be assigned to otherwise incompatible types:
</p>
<ul>
<li>
A value can be assigned to an interface variable if the static
type of the value implements the interface.
</li>
<li>
The predeclared constant
<code>
nil
</code>
can be assigned to any
pointer, function, slice, map, channel, or interface variable.
<li>
A pointer to an array can be assigned to a slice variable with compatible element type.
A pointer
<code>
p
</code>
to an array can be assigned to a slice variable
<code>
v
</code>
with compatible element type
if the type of
<code>
p
</code>
or
<code>
v
</code>
is unnamed.
The slice variable then refers to the original array; the data is not copied.
</li>
<li>
A value can be assigned to an interface variable if the static
type of the value implements the interface.
</li>
<li>
A value of bidirectional channel type can be assigned to any channel
variable of compatible channel value type.
A bidirectional channel
<code>
c
</code>
can be assigned to a channel variable
<code>
v
</code>
with compatible channel value type
if the type of
<code>
c
</code>
or
<code>
v
</code>
is unnamed.
</li>
</ul>
...
...
@@ -3846,13 +3849,13 @@ The following conversion rules apply:
</p>
<ul>
<li>
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
.
</li>
<li>
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)
.
</li>
<li>
3) Between integer types. If the value is a signed quantity, it is
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment