What version of Go are you using (go version)?
tip of master on gerrit.
$ go version
go version devel +d0eaec7 Wed Aug 28 21:48:01 2019 +0000 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/someone/.cache/go-build"
GOENV="/home/someone/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/someone/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/repos/go_002/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/repos/go_002/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build522812886=/tmp/go-build -gno-record-gcc-switches"
What did you do?
package main
func main() {
_ = uint(-4 + 2i)
}
https://play.golang.org/p/hIqU2ydLGdn
What did you expect to see?
A single error like "cannot convert complex to uint".
What did you see instead?
Two errors:
./prog.go:4:10: constant (-4+2i) truncated to integer
./prog.go:4:10: constant -4 overflows uint
What version of Go are you using (
go version)?tip of master on gerrit.
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
https://play.golang.org/p/hIqU2ydLGdn
What did you expect to see?
A single error like "cannot convert complex to uint".
What did you see instead?
Two errors: