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?
to your account
gc successfully compiles the following program:
var e = complex(0, 0i)
while gotype rejects it with:
invalid argument: 0i (untyped complex constant 0) must be a float32, float64, or an untyped non-complex numeric constant
go version devel +9b04852 Sat Jul 11 00:08:50 2015 +0000 linux/amd64
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
I believe this is a go/types bug. 0i is untyped and can be represented as a float32 or float64. The spec could be clearer.
Closed by mistake. Reopening.
CL https://golang.org/cl/12860 mentions this issue.
CL https://golang.org/cl/12937 mentions this issue.
spec: clarify semantics of built-in functions 'complex', 'real', and …
For golang#11669, golang#11540, golang#11945, golang#11946, golang#11947.
Reviewed-by: Russ Cox <email@example.com>
Reviewed-by: Rob Pike <firstname.lastname@example.org>
Successfully merging a pull request may close this issue.