New issue
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
cmd/compile: != operator incorrect for literal nil pointer compared to literal nil interface #19911
Labels
Comments
Fun! Bisecting. |
Go 1.8 agrees with tip. Go 1.7 rejects the code with:
|
Go 1.7 would be incorrect as well, as these are not constant expressions (nil is not a constant). |
gccgo says
|
Go 1.5 and 1.6 also say |
lparth
pushed a commit
to lparth/go
that referenced
this issue
Apr 13, 2017
Fixes golang#19911 Change-Id: Ib2b2505fe31ce00c6ffc021a0fe5df510633b44b Reviewed-on: https://go-review.googlesource.com/40251 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
See https://play.golang.org/p/fAb8AX92nf:
Expected output:
Actual output:
Note that the
(*ET)(nil) != error(nil)
case returnsfalse
. Unless I'm mistaken, it should returntrue
.The text was updated successfully, but these errors were encountered: