Skip to content
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

go/constant: BinaryOp does not support relational operators on numbers #17797

Closed
dominikh opened this issue Nov 4, 2016 · 4 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dominikh
Copy link
Member

dominikh commented Nov 4, 2016

What version of Go are you using (go version)?

go version go1.7.3 linux/amd64

What did you do?

https://play.golang.org/p/Paqll33YBG

What did you expect to see?

false

What did you see instead?

panic: invalid binary operation 0 < 0

goroutine 1 [running]:
panic(0x132680, 0x1050a138)
	/usr/local/go/src/runtime/panic.go:500 +0x720
go/constant.BinaryOp(0x1c0e20, 0x1050e160, 0x28, 0x1c0e20, 0x1050e168, 0x1050e0f8, 0x0, 0x0)
	/usr/local/go/src/go/constant/value.go:1110 +0x2c0
main.main()
	/tmp/sandbox478253161/main.go:11 +0xa0
@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 4, 2016
@quentinmit quentinmit added this to the Go1.8Maybe milestone Nov 4, 2016
@quentinmit
Copy link
Contributor

This might be too late for 1.8, depending on how much work it is to fix.

@JayNakrani
Copy link
Contributor

BinaryOp() does not handle comparison operations, Compare() does. Is it supposed to?
If not, we should give more helpful message saying that op X is not supported, and put that in doc as well (that would be trivial and can be done in time for 1.8).

@dominikh
Copy link
Member Author

dominikh commented Nov 5, 2016

I did not see Compare. I think a doc change on BinaryOp should suffice for now.

@griesemer griesemer self-assigned this Nov 5, 2016
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/32761 mentions this issue.

@golang golang locked and limited conversation to collaborators Nov 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants