1
0
mirror of https://github.com/golang/go synced 2024-10-05 07:11:22 -06:00
go/src
Caio Marcelo de Oliveira Filho 133c26b158 go/types: don't emit conversion error in non-numeric increment/decrement
In increment and decrement statements, explicit check that the type
of operand is numeric. This avoids a related but less clear error
about converting "1" to be emitted.

So, when checking

	package main

	func main() {
		var x bool
		x++
	}

instead of emitting the error

	prog.go:5:2: cannot convert 1 (untyped int constant) to bool

emits

	prog.go:5:2: invalid operation: x++ (non-numeric type bool).

Updates #12525.

Change-Id: I00aa6bd0bb23267a2fe10ea3f5a0b20bbf3552bc
Reviewed-on: https://go-review.googlesource.com/20244
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-07 20:53:49 +00:00
..
archive all: single space after period. 2016-03-02 00:13:47 +00:00
bufio bufio: Reader.Peek returns partial results on ErrBufferFull 2016-03-04 03:51:22 +00:00
builtin
bytes all: single space after period. 2016-03-02 00:13:47 +00:00
cmd cmd/compile/internal/ppc64: clean up table initalisation 2016-03-07 20:46:53 +00:00
compress compress/zlib: make errors persistent 2016-03-07 18:32:04 +00:00
container all: single space after period. 2016-03-02 00:13:47 +00:00
crypto crypto/cipher: xorBytes performance ppc64le/ppc64 2016-03-05 01:51:33 +00:00
database/sql all: single space after period. 2016-03-02 00:13:47 +00:00
debug Rewrite leftover references to plan9.bell-labs.com to 9p.io. 2016-03-06 07:07:01 +00:00
encoding all: single space after period. 2016-03-02 00:13:47 +00:00
errors all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
expvar all: single space after period. 2016-03-02 00:13:47 +00:00
flag all: single space after period. 2016-03-02 00:13:47 +00:00
fmt fmt: refactor and unify float and complex formatting 2016-03-06 02:18:05 +00:00
go go/types: don't emit conversion error in non-numeric increment/decrement 2016-03-07 20:53:49 +00:00
hash cmd/internal/obj/x86: add new instructions, cleanup. 2016-01-13 14:04:44 +00:00
html all: single space after period. 2016-03-02 00:13:47 +00:00
image Rewrite leftover references to plan9.bell-labs.com to 9p.io. 2016-03-06 07:07:01 +00:00
index/suffixarray
internal all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
io all: single space after period. 2016-03-02 00:13:47 +00:00
log all: single space after period. 2016-03-02 00:13:47 +00:00
math math/big: use correct precision in Float.Float32/64 for denormals 2016-03-04 17:39:50 +00:00
mime mime/multipart: don't call Read on io.Reader after an error is seen 2016-03-07 19:50:16 +00:00
net net: deduplicate TCP socket code 2016-03-03 04:23:59 +00:00
os os/user: make Current work without cgo 2016-03-07 20:22:32 +00:00
path Rewrite leftover references to plan9.bell-labs.com to 9p.io. 2016-03-06 07:07:01 +00:00
reflect reflect: recognize unnamed directional channels 2016-03-04 20:34:30 +00:00
regexp all: single space after period. 2016-03-02 00:13:47 +00:00
runtime runtime: eliminate unnecessary type conversions 2016-03-07 20:53:27 +00:00
sort all: single space after period. 2016-03-02 00:13:47 +00:00
strconv all: single space after period. 2016-03-02 00:13:47 +00:00
strings all: single space after period. 2016-03-02 00:13:47 +00:00
sync all: single space after period. 2016-03-02 00:13:47 +00:00
syscall all: single space after period. 2016-03-02 00:13:47 +00:00
testing all: single space after period. 2016-03-02 00:13:47 +00:00
text all: single space after period. 2016-03-02 00:13:47 +00:00
time all: single space after period. 2016-03-02 00:13:47 +00:00
unicode all: single space after period. 2016-03-02 00:13:47 +00:00
unsafe all: single space after period. 2016-03-02 00:13:47 +00:00
vendor net/http: update http2 to check header values, move from vendor to internal 2016-01-21 00:19:02 +00:00
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash build: use consistent shebang line 2016-01-14 03:16:20 +00:00
buildall.bash build: use go tool dist list 2016-02-26 03:58:58 +00:00
clean.bash
clean.bat
clean.rc
iostest.bash
make.bash cmd/go, go/build: add support for Fortran 2016-02-24 15:06:38 +00:00
make.bat cmd/go, go/build: add support for Fortran 2016-02-24 15:06:38 +00:00
Make.dist
make.rc
nacltest.bash
race.bash cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
race.bat cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.bash cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.bat cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00
run.rc cmd/dist: make test default to --no-rebuild 2015-12-29 15:20:00 +00:00