Skip to content

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

@agnivade

Description

@agnivade

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions