go/types: complex(0, 0i) should be permitted
dvyukov opened this issue · 5 comments
dvyukov commented
gc successfully compiles the following program:
package a
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
dvyukov commented
- @griesemer for spec treatment
griesemer commented
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.
griesemer commented
Closed by mistake. Reopening.
gopherbot commented
CL https://golang.org/cl/12860 mentions this issue.
gopherbot commented
CL https://golang.org/cl/12937 mentions this issue.