You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
prog.go:4:15: cannot convert nil to type int
as it does for Go1.9 and before
What did you see instead?
prog.go:4:15: cannot convert nil () to type int
While the current disambiguation of including the type in the error is quite nice, it's a minor oversight that we forgot to check first if the type is nil before trying to print the type by it's print verb. I think this issue is a low hanging fruit that we can fix for Go1.10 since it is even a regression anyways but more importantly IMHO we'll have a whole lot of odd error messages for Go1.10 if we don't fix it #elevatorPitchToFixIt
The text was updated successfully, but these errors were encountered:
odeke-em
changed the title
cmd/compile: do not attempt to print type if unknown
cmd/compile: do not attempt to print type if unknown in "cannot convert" error message
Jan 12, 2018
Hmm, I can't reproduce this bug in a weird twist, perhaps this was just a change that I had made with my local version. My apologies for the false alarm, there is no issue here.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version devel +a6b9385 Thu Jan 4 21:55:42 2018 +0000 darwin/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN="/Users/emmanuelodeke/go/bin"
GOCACHE="/Users/emmanuelodeke/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/emmanuelodeke/go"
GORACE=""
GOROOT="/Users/emmanuelodeke/go/src/go.googlesource.com/go"
GOTMPDIR=""
GOTOOLDIR="/Users/emmanuelodeke/go/src/go.googlesource.com/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/v3/7z434qpx5v3bw0wh8h2myfpw0000gn/T/go-build865828038=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
Given this code https://play.golang.org/p/aDVRtb8yKMe
or inlined below
What did you expect to see?
prog.go:4:15: cannot convert nil to type int
as it does for Go1.9 and before
What did you see instead?
prog.go:4:15: cannot convert nil () to type int
While the current disambiguation of including the type in the error is quite nice, it's a minor oversight that we forgot to check first if the type is nil before trying to print the type by it's print verb. I think this issue is a low hanging fruit that we can fix for Go1.10 since it is even a regression anyways but more importantly IMHO we'll have a whole lot of odd error messages for Go1.10 if we don't fix it #elevatorPitchToFixIt
The text was updated successfully, but these errors were encountered: