aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Martin <ality@pbrane.org>2010-11-22 10:59:51 -0500
committerRuss Cox <rsc@golang.org>2010-11-22 10:59:51 -0500
commit1ee4512b98edfadbd2e12fb983232cf08cd8b31d (patch)
tree0345e84e5038939b7400b54ac02a685bee2d52b8
parente21aac29ba179c310b4b834bc3c37f152ab20bf2 (diff)
downloadgo-1ee4512b98edfadbd2e12fb983232cf08cd8b31d.tar.gz
go-1ee4512b98edfadbd2e12fb983232cf08cd8b31d.zip
gc: better error message for bad type in channel send
# test program 1 package main 2 3 type C chan int 4 5 func F(c C) { 6 c <- true 7 } # old error test.go:6: cannot use true (type bool) as type int in function argument # new error test.go:6: cannot use true (type bool) as type int in channel send R=rsc, ejsherry CC=golang-dev https://golang.org/cl/3231042
-rw-r--r--src/cmd/gc/typecheck.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c
index 919d99ecf7..70464a4b76 100644
--- a/src/cmd/gc/typecheck.c
+++ b/src/cmd/gc/typecheck.c
@@ -656,6 +656,7 @@ reswitch:
r = n->right;
if((t = r->type) == T)
goto error;
+ r = assignconv(r, l->type->type, "send");
// TODO: more aggressive
n->etype = 0;
n->type = T;