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

Comments

@griesemer
Copy link
Contributor

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 modified the milestones: Go1.8Maybe, Go1.8 Aug 23, 2016
@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 10, 2016
@rsc rsc modified the milestones: Go1.9, Go1.8Maybe Nov 11, 2016
@griesemer
Copy link
Contributor Author

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
@griesemer
Copy link
Contributor Author

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

No branches or pull requests

3 participants