summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-25 13:13:02 -0400
committerRuss Cox <rsc@golang.org>2014-09-25 13:13:02 -0400
commitc0bad3b451dd0153f9dcb0a3f2280cc08fd31679 (patch)
tree4cd5c515203607e327f600545e947b5cb9ec1a9b /test
parent19c8e5190dd9bd90cb21f3491e70db9b01844b6f (diff)
downloadgo-c0bad3b451dd0153f9dcb0a3f2280cc08fd31679.tar.gz
cmd/gc: print x++ (not x += 1) in errors about x++
Fixes issue 8311. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews, r https://codereview.appspot.com/146270043
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue8311.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/fixedbugs/issue8311.go b/test/fixedbugs/issue8311.go
new file mode 100644
index 000000000..dd928566d
--- /dev/null
+++ b/test/fixedbugs/issue8311.go
@@ -0,0 +1,16 @@
+// errorcheck
+
+// Copyright 2014 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.
+
+// issue 8311.
+// error for x++ should say x++ not x += 1
+
+package p
+
+func f() {
+ var x []byte
+ x++ // ERROR "invalid operation: x[+][+]"
+
+}