]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: type conversions never have side effects
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 22 Nov 2017 21:00:36 +0000 (21:00 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 27 Feb 2018 21:48:10 +0000 (21:48 +0000)
commitc55505bae23940a0e253a9ea6f25577c7123c6c0
treef9884da5eb81bb1e64d46f7c84cd3498a89793dc
parentc2ccc48165255454e27d0fccbb7b3cb84aee638f
cmd/vet: type conversions never have side effects

Make the hasSideEffects func use type information to see if a CallExpr
is a type conversion or not. In case it is, there cannot be any side
effects.

Now that vet always has type information, we can afford to use it here.
Update the tests and remove the TODO there too.

Change-Id: I74fdacf830aedf2371e67ba833802c414178caf1
Reviewed-on: https://go-review.googlesource.com/79536
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/vet/assign.go
src/cmd/vet/bool.go
src/cmd/vet/testdata/bool.go