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

cmd/compile: Confusing error: "float64(1) returns 0 results" #11428

Closed
tv42 opened this issue Jun 26, 2015 · 1 comment
Closed

cmd/compile: Confusing error: "float64(1) returns 0 results" #11428

tv42 opened this issue Jun 26, 2015 · 1 comment
Milestone

Comments

@tv42
Copy link

tv42 commented Jun 26, 2015

http://play.golang.org/p/cUp0WhWv-c

package main

func main() {
    _ = complex(float64(1))
}
/tmp/sandbox460390042/main.go:4: invalid operation: complex expects two arguments, float64(1) returns 0 results

I would have expected it to say "1 result".

@griesemer
Copy link
Contributor

This appears to be fixed on tip. For:

package main
func main() {
    _ = complex(float64(1))
}

I see:

./x.go:3: invalid operation: complex expects two arguments

With gotype, I see:

$ gotype x.go
x.go:3:27: invalid operation: not enough arguments for complex(float64(1)) (expected 2, found 1)

@mikioh mikioh changed the title Confusing error: "float64(1) returns 0 results" cmd/compile: Confusing error: "float64(1) returns 0 results" Jun 26, 2015
@mikioh mikioh added this to the Go1.5 milestone Jun 26, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants