We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tried to convert a bool to an int. For example: x := int(false) https://play.golang.org/p/5eGVyWi1kH
a single error message
two slightly different error messages for the same source location
main.go:4:9: cannot convert false to type int main.go:4:9: cannot convert false (type bool) to type int
go version go1.9.2 linux/amd64 GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/gouser/go" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build143268145=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOROOT/bin/go version: go version go1.9.2 linux/amd64 GOROOT/bin/go tool compile -V: compile version go1.9.2 uname -sr: Linux 4.9.0-4-amd64 Distributor ID: Debian Description: Debian GNU/Linux 9.2 (stretch) Release: 9.2 Codename: stretch /lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Debian GLIBC 2.24-11+deb9u1) stable release version 2.24, by Roland McGrath et al. gdb --version: GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
The text was updated successfully, but these errors were encountered:
I guess the issue has been fixed by d05a123. See #20812.
Acutally, the issue cannot be reproduced in my local, its output now is:
main.go:4:9: cannot convert false (type untyped bool) to type int`
My go version is go version devel +25363de Fri Dec 8 16:54:20 2017 +0000 darwin/amd64.
go version devel +25363de Fri Dec 8 16:54:20 2017 +0000 darwin/amd64
Sorry, something went wrong.
Was about to write the same - cannot reproduce on tip either. Seems like a duplicate indeed.
Yeah, I searched for issues about bools and "double error" but I did not search for "duplicate error"
Thanks.
No branches or pull requests
What did you do?
Tried to convert a bool to an int.
For example: x := int(false)
https://play.golang.org/p/5eGVyWi1kH
What did you expect to see?
a single error message
What did you see instead?
two slightly different error messages for the same source location
System details
The text was updated successfully, but these errors were encountered: