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: provide better error message for errors in n:1 init assignment #15783

Open
griesemer opened this issue May 21, 2016 · 2 comments
Open

go/types: provide better error message for errors in n:1 init assignment #15783

griesemer opened this issue May 21, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented May 21, 2016

Given a.go:

package p

var a, b []int = f1() // error

func f1() (_ []int, _ int) {
    return
}

gotype reports:

$ gotype a.go
a.go:3:18: cannot use f1() (value of type int) as []int value in assignment

vs gc compiler:

$ go tool compile a.go
a.go:3: cannot assign int to b (type []int) in multiple assignment

The gc compiler's error message is much better.

@griesemer griesemer self-assigned this May 21, 2016
@griesemer griesemer added this to the Go1.8 milestone May 21, 2016
@griesemer griesemer added this to the Go1.8Maybe milestone Aug 23, 2016
@griesemer griesemer removed this from the Go1.8 milestone Aug 23, 2016
@rsc rsc added this to the Go1.9 milestone Nov 11, 2016
@rsc rsc removed this from the Go1.8Maybe milestone Nov 11, 2016
@griesemer
Copy link
Contributor Author

@griesemer griesemer commented Feb 15, 2017

Not urgent. Pushing to 1.9 Maybe.

@griesemer griesemer added this to the Go1.9Maybe milestone Feb 15, 2017
@griesemer griesemer removed this from the Go1.9 milestone Feb 15, 2017
@griesemer griesemer added this to the Go1.10 milestone Jun 16, 2017
@griesemer griesemer removed this from the Go1.9Maybe milestone Jun 16, 2017
@rsc rsc removed this from the Go1.10 milestone Nov 22, 2017
@rsc rsc added this to the Go1.11 milestone Nov 22, 2017
@griesemer
Copy link
Contributor Author

@griesemer griesemer commented May 24, 2018

Still not urgent. Pushing to 1.12.

@griesemer griesemer removed this from the Go1.11 milestone May 24, 2018
@griesemer griesemer added this to the Go1.12 milestone May 24, 2018
@griesemer griesemer removed this from the Go1.12 milestone Oct 19, 2018
@griesemer griesemer added this to the Unplanned milestone Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants