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
6865cc0e
Commit
6865cc0e
authored
Apr 02, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: avoid saying same error 3 times
R=ken2 CC=golang-dev
https://golang.org/cl/4316051
parent
46137557
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
const.c
src/cmd/gc/const.c
+0
-1
subr.c
src/cmd/gc/subr.c
+4
-1
ddd1.go
test/ddd1.go
+1
-1
No files found.
src/cmd/gc/const.c
View file @
6865cc0e
...
...
@@ -136,7 +136,6 @@ convlit1(Node **np, Type *t, int explicit)
case
CTNIL
:
switch
(
et
)
{
default:
yyerror
(
"cannot use nil as %T"
,
t
);
n
->
type
=
T
;
goto
bad
;
...
...
src/cmd/gc/subr.c
View file @
6865cc0e
...
...
@@ -2053,13 +2053,16 @@ Node*
assignconv
(
Node
*
n
,
Type
*
t
,
char
*
context
)
{
int
op
;
Node
*
r
;
Node
*
r
,
*
old
;
char
*
why
;
if
(
n
==
N
||
n
->
type
==
T
)
return
n
;
old
=
n
;
old
->
diag
++
;
// silence errors about n; we'll issue one below
defaultlit
(
&
n
,
t
);
old
->
diag
--
;
if
(
t
->
etype
==
TBLANK
)
return
n
;
...
...
test/ddd1.go
View file @
6865cc0e
...
...
@@ -15,7 +15,7 @@ var (
_
=
sum
()
_
=
sum
(
1.0
,
2.0
)
_
=
sum
(
1.5
)
// ERROR "integer"
_
=
sum
(
"hello"
)
// ERROR "
conver
t|incompatible"
_
=
sum
(
"hello"
)
// ERROR "
string.*as type in
t|incompatible"
_
=
sum
([]
int
{
1
})
// ERROR "slice literal.*as type int|incompatible"
)
...
...
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