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
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@griesemer
Copy link
Contributor

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

package p

func f(x, y, z ...int)
@griesemer griesemer added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Oct 19, 2018
@griesemer griesemer added this to the Go1.12 milestone Oct 19, 2018
@griesemer griesemer self-assigned this Oct 19, 2018
@gopherbot
Copy link

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

@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

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.

@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.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants