]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: further clarify assignment count mismatch error message
authorJeremy Jackins <jeremyjackins@gmail.com>
Thu, 16 Mar 2017 22:49:06 +0000 (15:49 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 16 Mar 2017 23:58:33 +0000 (23:58 +0000)
commit73a44f0456389c60db8459981868b4c64874ec0b
treec96e463af7e9d6938a3cea952e86f192ba46aaf0
parent495b167919b1473e02843135f57d310cdd4f5789
cmd/compile: further clarify assignment count mismatch error message

This is an evolution of https://go-review.googlesource.com/33616, as discussed
via email with Robert (gri):

$ cat foobar.go
package main

func main() {
        a := "foo", "bar"
}

before:
./foobar.go:4:4: assignment count mismatch: want 1 values, got 2

after:
./foobar.go:4:4: assignment count mismatch: cannot assign 2 values to 1 variables

We could likely also eliminate the "assignment count mismatch" prefix now
without losing any information, but that string is matched by a number of
tests.

Change-Id: Ie6fc8a7bbd0ebe841d53e66e5c2f49868decf761
Reviewed-on: https://go-review.googlesource.com/38313
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/typecheck.go