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

Comments

Projects
None yet
4 participants
@agnivade
Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

commented Feb 5, 2019

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

@andybons

This comment has been minimized.

Copy link
Member

commented Feb 5, 2019

@agnivade

This comment has been minimized.

Copy link
Member Author

commented Feb 7, 2019

Was simple enough so I mailed it myself.

@gopherbot

This comment has been minimized.

Copy link

commented Feb 7, 2019

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

This comment has been minimized.

Copy link
Member Author

commented Feb 7, 2019

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

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.