-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: failure to diagnose invalid conversion to complex64 #11590
Comments
I don't believe this is a gc bug. First of all, the conversion is not illegal - an untyped int constant can be converted into a complex value. The complaints are about overflow. But the value 774516156475830989403545856475830078125 is converted into a float64 w/o problem:
Making this a go/types bug. |
Never mind - my bad! It's complex64 - not complex128! (I hate these names). Indeed, "var _ float32 = 774516156475830989403545856475830078125" is not valid because the number is too large for any float32, and thus too large for any complex64 component. gc should not accept this. Changing back to gc bug. Sorry. |
CL forthcoming. |
CL https://golang.org/cl/16920 mentions this issue. |
gc successfully compiles the following program:
while both gccgo and go/types reject it with:
go version devel +40a1516 Fri Jul 3 03:08:40 2015 +0000 linux/amd64
The text was updated successfully, but these errors were encountered: