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

griesemer opened this issue May 21, 2016 · 2 comments


None yet
3 participants
Copy link

commented May 21, 2016

Given a.go:

package p

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

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

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 modified the milestones: Go1.8Maybe, Go1.8 Aug 23, 2016

@quentinmit quentinmit added the NeedsFix label Oct 10, 2016

@rsc rsc modified the milestones: Go1.9, Go1.8Maybe Nov 11, 2016


This comment has been minimized.

Copy link
Contributor Author

commented Feb 15, 2017

Not urgent. Pushing to 1.9 Maybe.

@griesemer griesemer modified the milestones: Go1.9Maybe, Go1.9 Feb 15, 2017

@griesemer griesemer modified the milestones: Go1.10, Go1.9Maybe Jun 16, 2017

@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017


This comment has been minimized.

Copy link
Contributor Author

commented May 24, 2018

Still not urgent. Pushing to 1.12.

@griesemer griesemer modified the milestones: Go1.11, Go1.12 May 24, 2018

@griesemer griesemer modified the milestones: Go1.12, Unplanned Oct 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.