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/gc: incorrect error message #10671

Closed
davecheney opened this issue May 2, 2015 · 4 comments
Closed

cmd/gc: incorrect error message #10671

davecheney opened this issue May 2, 2015 · 4 comments

Comments

@davecheney
Copy link
Contributor

The following incorrect program

package main

func f(a, b string, bool) bool {
        return true
}

func main() {
        println(f(true))
}

produces this error message when compiled

lucky(~/src) % go build q.go                                                                                                                                    
# command-line-arguments
./q.go:3: final function parameter must have type

Which I believe is wrong, the final parameter does have a type, bool, what is lacks is a name.

@josharian
Copy link
Contributor

gc thinks that bool is the name. Related: #10579

@minux
Copy link
Member

minux commented May 3, 2015 via email

@josharian
Copy link
Contributor

It makes for a fun error message: http://play.golang.org/p/WiAk8ktzxK

@ianlancetaylor
Copy link
Contributor

Not sure how we can do better here.

@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

5 participants