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

go/types: don't accept invalid signature func f(x, y, z ...int) #28281

Closed
griesemer opened this issue Oct 19, 2018 · 2 comments
Closed

go/types: don't accept invalid signature func f(x, y, z ...int) #28281

griesemer opened this issue Oct 19, 2018 · 2 comments

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Oct 19, 2018

Neither the parser not the type-checker appear to refuse this code:

package p

func f(x, y, z ...int)
@griesemer griesemer added this to the Go1.12 milestone Oct 19, 2018
@griesemer griesemer self-assigned this Oct 19, 2018
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 22, 2018

Change https://golang.org/cl/143857 mentions this issue: go/types: report error for invalid use of ... in parameter lists

Loading

@griesemer griesemer changed the title go/parser, go/types: don't accept invalid signature func f(x, y, z ...int) go/types: don't accept invalid signature func f(x, y, z ...int) Oct 22, 2018
@griesemer
Copy link
Contributor Author

@griesemer griesemer commented Oct 22, 2018

The go/parser refuses them in receiver and result parameter lists. It might be better to accept them everywhere and just leave it to the type checker. Filed follow-up issue #28326 for that (long-term); this is about the stop gap fix to make sure we recognized the error somewhere.

Loading

@gopherbot gopherbot closed this in 553237a Oct 22, 2018
@golang golang locked and limited conversation to collaborators Oct 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants