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
07fc1457
Commit
07fc1457
authored
Jan 19, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: be more specific about copy type errors
Fixes #539. R=ken2 CC=golang-dev
https://golang.org/cl/190043
parent
da225c23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
typecheck.c
src/cmd/gc/typecheck.c
+9
-2
No files found.
src/cmd/gc/typecheck.c
View file @
07fc1457
...
...
@@ -810,12 +810,19 @@ reswitch:
goto
error
;
toslice
(
&
n
->
left
);
toslice
(
&
n
->
right
);
defaultlit
(
&
n
->
left
,
T
);
defaultlit
(
&
n
->
right
,
T
);
if
(
!
isslice
(
n
->
left
->
type
)
||
!
isslice
(
n
->
right
->
type
))
{
yyerror
(
"arguments to copy must be slices or array pointers"
);
if
(
!
isslice
(
n
->
left
->
type
)
&&
!
isslice
(
n
->
right
->
type
))
yyerror
(
"arguments to copy must be array pointer or slice; have %lT, %lT"
,
n
->
left
->
type
,
n
->
right
->
type
);
else
if
(
!
isslice
(
n
->
left
->
type
))
yyerror
(
"first argument to copy should be array pointer or slice; have %lT"
,
n
->
left
->
type
);
else
yyerror
(
"second argument to copy should be array pointer or slice; have %lT"
,
n
->
right
->
type
);
goto
error
;
}
if
(
!
eqtype
(
n
->
left
->
type
,
n
->
right
->
type
))
{
yyerror
(
"arguments to copy
must have the same type element type"
);
yyerror
(
"arguments to copy
have different element types %lT and %lT"
,
n
->
left
->
type
,
n
->
right
->
type
);
goto
error
;
}
goto
ret
;
...
...
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