Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
01c2de0c
Commit
01c2de0c
authored
Nov 18, 2009
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow copy to be used without a return value
R=rsc
https://golang.org/cl/156060
parent
41554e25
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
typecheck.c
src/cmd/gc/typecheck.c
+8
-8
No files found.
src/cmd/gc/typecheck.c
View file @
01c2de0c
...
...
@@ -762,7 +762,7 @@ reswitch:
goto
ret
;
case
OCOPY
:
ok
|=
Erv
;
ok
|=
E
top
|
E
rv
;
args
=
n
->
list
;
if
(
args
==
nil
||
args
->
next
==
nil
)
{
yyerror
(
"missing arguments to copy"
);
...
...
@@ -772,19 +772,19 @@ reswitch:
yyerror
(
"too many arguments to copy"
);
goto
error
;
}
typecheck
(
&
args
->
n
,
Erv
);
typecheck
(
&
args
->
next
->
n
,
Erv
);
if
(
!
isslice
(
args
->
n
->
type
)
||
!
isslice
(
args
->
next
->
n
->
type
))
{
n
->
left
=
args
->
n
;
n
->
right
=
args
->
next
->
n
;
n
->
type
=
types
[
TINT
];
typecheck
(
&
n
->
left
,
Erv
);
typecheck
(
&
n
->
right
,
Erv
);
if
(
!
isslice
(
n
->
left
->
type
)
||
!
isslice
(
n
->
right
->
type
))
{
yyerror
(
"arguments to copy must be slices"
);
goto
error
;
}
if
(
!
eqtype
(
args
->
n
->
type
,
args
->
next
->
n
->
type
))
{
if
(
!
eqtype
(
n
->
left
->
type
,
n
->
right
->
type
))
{
yyerror
(
"arguments to copy must be slices of the same type"
);
goto
error
;
}
n
->
left
=
args
->
n
;
n
->
right
=
args
->
next
->
n
;
n
->
type
=
types
[
TINT
];
goto
ret
;
case
OCONV
:
...
...
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