diff options
author | Russ Cox <rsc@golang.org> | 2014-09-25 13:13:02 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-09-25 13:13:02 -0400 |
commit | 52e9bcafe1b5bdae3354ddf82879751dfe6eb25b (patch) | |
tree | 9588128485f36c1df38176c2ee8d9699fe228768 /test/fixedbugs/issue8311.go | |
parent | 53c66543e022b1a96a599fee0819f6b16e92bead (diff) | |
download | go-git-52e9bcafe1b5bdae3354ddf82879751dfe6eb25b.tar.gz |
cmd/gc: print x++ (not x += 1) in errors about x++
Fixes #8311.
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews, r
https://golang.org/cl/146270043
Diffstat (limited to 'test/fixedbugs/issue8311.go')
-rw-r--r-- | test/fixedbugs/issue8311.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/fixedbugs/issue8311.go b/test/fixedbugs/issue8311.go new file mode 100644 index 0000000000..dd928566d6 --- /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[+][+]" + +} |