aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgriesemer <gri@golang.org>2017-10-05 14:20:51 -0700
committerRobert Griesemer <gri@golang.org>2017-10-06 16:35:44 +0000
commitb77d9fe0ead35a30cbe449ae805bc4a8770b4a68 (patch)
tree589257d488792beb460382da82e3a4861d8d0cd3 /src
parente33b01651cccce4293eb7a2ae7b40774e1dbeec9 (diff)
downloadgo-b77d9fe0ead35a30cbe449ae805bc4a8770b4a68.tar.xz
cmd/compile: better error message for assignment mismatches
Keep left-to-right order when referring to the number of variables and values involved. Fixes #22159. Change-Id: Iccca12d3222f9d5e049939a9ccec07513c393faa Reviewed-on: https://go-review.googlesource.com/68690 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/gc/typecheck.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go
index a6c54f4569..ab2c77a3fb 100644
--- a/src/cmd/compile/internal/gc/typecheck.go
+++ b/src/cmd/compile/internal/gc/typecheck.go
@@ -3426,7 +3426,7 @@ func typecheckas2(n *Node) {
}
mismatch:
- yyerror("cannot assign %d values to %d variables", cr, cl)
+ yyerror("assignment mismatch: %d variables but %d values", cl, cr)
// second half of dance
out: