]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: avoid duplicate cast error
authorKashav Madan <kshvmdn@gmail.com>
Tue, 27 Jun 2017 23:29:59 +0000 (19:29 -0400)
committerRobert Griesemer <gri@golang.org>
Tue, 22 Aug 2017 13:44:35 +0000 (13:44 +0000)
commitd05a1238d6811aa11abf117e668cd9c4f4c15e6a
tree7ca5e83758d021619a925b56a79e6b31650349b9
parent63c428434692bdeab14115a1f70813feca7795e7
cmd/compile: avoid duplicate cast error

If an error was already printed during LHS conversion step, we don't reprint
the "cannot convert" error.

In particular, this prevents `_ = int("1")` (and all similar casts) from
resulting in multiple identical error messages being printed.

Fixes #20812.

Change-Id: If6e52c59eab438599d641ecf6f110ebafca740a9
Reviewed-on: https://go-review.googlesource.com/46912
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/typecheck.go
test/fixedbugs/issue20812.go [new file with mode: 0644]
test/rename1.go