diff options
author | Kashav Madan <kshvmdn@gmail.com> | 2017-06-27 19:29:59 -0400 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2017-08-22 13:44:35 +0000 |
commit | d05a1238d6811aa11abf117e668cd9c4f4c15e6a (patch) | |
tree | 7ca5e83758d021619a925b56a79e6b31650349b9 /test/rename1.go | |
parent | 63c428434692bdeab14115a1f70813feca7795e7 (diff) | |
download | go-d05a1238d6811aa11abf117e668cd9c4f4c15e6a.tar.gz go-d05a1238d6811aa11abf117e668cd9c4f4c15e6a.zip |
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>
Diffstat (limited to 'test/rename1.go')
-rw-r--r-- | test/rename1.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/rename1.go b/test/rename1.go index a71e5b2e53..568aa13d44 100644 --- a/test/rename1.go +++ b/test/rename1.go @@ -10,10 +10,10 @@ package main func main() { - var n byte // ERROR "not a type|expected type" + var n byte // ERROR "not a type|expected type" var y = float32(0) // ERROR "cannot call|expected function" const ( - a = 1 + iota // ERROR "string|incompatible types" "convert iota" + a = 1 + iota // ERROR "invalid operation|incompatible types" "cannot convert iota" ) } |