summaryrefslogtreecommitdiff
path: root/test/fixedbugs/issue9521.go
diff options
context:
space:
mode:
authorDidier Spezia <didier.06@gmail.com>2015-05-09 17:21:42 +0000
committerIan Lance Taylor <iant@golang.org>2015-05-11 17:44:31 +0000
commit7c0db1b7e23e14f7a9cc0c424f57a57a613846d3 (patch)
treefe177faec40214a191c6c3ca073acc79a4e11327 /test/fixedbugs/issue9521.go
parent3475ec7f36b68126310878e611c8594514b98438 (diff)
downloadgo-git-7c0db1b7e23e14f7a9cc0c424f57a57a613846d3.tar.gz
cmd/gc: do not display ~b identifiers in error messages
Instead of errors like: ./blank2.go:15: cannot use ~b1 (type []int) as type int in assignment we now have: ./blank2.go:15: cannot use _ (type []int) as type int in assignment Less confusing for users. Fixes #9521 Change-Id: Ieab9859040e8e0df95deeaee7eeb408d3be61c0f Reviewed-on: https://go-review.googlesource.com/9902 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'test/fixedbugs/issue9521.go')
-rw-r--r--test/fixedbugs/issue9521.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/fixedbugs/issue9521.go b/test/fixedbugs/issue9521.go
new file mode 100644
index 0000000000..51b5204e7a
--- /dev/null
+++ b/test/fixedbugs/issue9521.go
@@ -0,0 +1,16 @@
+// errorcheck
+
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test that an incorrect use of the blank identifer is caught.
+// Does not compile.
+
+package main
+
+func f() (_, _ []int) { return }
+
+func main() {
+ _ = append(f()) // ERROR "cannot use _"
+}