From c0bad3b451dd0153f9dcb0a3f2280cc08fd31679 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 25 Sep 2014 13:13:02 -0400 Subject: 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 --- test/fixedbugs/issue8311.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/fixedbugs/issue8311.go (limited to 'test') 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[+][+]" + +} -- cgit v1.2.1