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

cmd/compile: grammatical mistake in assignment mismatch error #30087

Closed
agnivade opened this issue Feb 5, 2019 · 7 comments
Closed

cmd/compile: grammatical mistake in assignment mismatch error #30087

agnivade opened this issue Feb 5, 2019 · 7 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@agnivade
Copy link
Contributor

agnivade commented Feb 5, 2019

What version of Go are you using (go version)?

$ go version
go version devel +faf187fb8e Thu Jan 31 16:55:43 2019 +0000 linux/amd64

What did you do?

package main

func main() {
  var a, b = 1
}

On running this,

1.11 gives -

# command-line-arguments
./reserved.go:4:6: assignment mismatch: 2 variables but 1 values

tip gives -

./reserved.go:4:6: assignment mismatch: 2 variable but 1 values

This was introduced in commit ae9c822

Author: David Heuschmann heuschmann.d@gmail.com
Date: Sat Sep 15 13:04:59 2018 +0200

cmd/compile: use more specific error message for assignment mismatch

Show a more specifc error message in the form of "%d variables but %v
returns %d values" if an assignment mismatch occurs with a function
or method call on the right.

Fixes #27595

Marking as release blocker since this was introduced in 1.12.

/cc @griesemer

@agnivade agnivade added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Feb 5, 2019
@agnivade agnivade added this to the Go1.12 milestone Feb 5, 2019
@agnivade
Copy link
Contributor Author

agnivade commented Feb 5, 2019

I do note that "1 values" was always incorrect. However, since variables got changed to variable, I think this technically qualifies as a regression.

@mvdan
Copy link
Member

mvdan commented Feb 5, 2019

While this issue makes sense, I wonder if it's worth blocking 1.12 further just for an error typo. I presume the fix could be included in a bugfix release like 1.12.1.

@agnivade
Copy link
Contributor Author

agnivade commented Feb 5, 2019

Makes sense. Will leave it to @griesemer to take the final call.

@andybons
Copy link
Member

andybons commented Feb 5, 2019

@dddent

@agnivade
Copy link
Contributor Author

agnivade commented Feb 7, 2019

Was simple enough so I mailed it myself.

@gopherbot
Copy link

Change https://golang.org/cl/161577 mentions this issue: cmd/compile: fix a typo in assignment mismatch error

@agnivade agnivade modified the milestones: Go1.12, Go1.13 Feb 7, 2019
@agnivade
Copy link
Contributor Author

agnivade commented Feb 7, 2019

Re-milestoned as per @griesemer's comments on the CL.

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.
Projects
None yet
Development

No branches or pull requests

4 participants