1
0
mirror of https://github.com/golang/go synced 2024-11-23 09:50:03 -07:00
go/test/fixedbugs/bug289.go
griesemer b77d9fe0ea cmd/compile: better error message for assignment mismatches
Keep left-to-right order when referring to the number of
variables and values involved.

Fixes #22159.

Change-Id: Iccca12d3222f9d5e049939a9ccec07513c393faa
Reviewed-on: https://go-review.googlesource.com/68690
Reviewed-by: Russ Cox <rsc@golang.org>
2017-10-06 16:35:44 +00:00

27 lines
466 B
Go

// errorcheck
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// https://code.google.com/p/gofrontend/issues/detail?id=1
package main
func f1() {
a, b := f() // ERROR "assignment mismatch|does not match"
_ = a
_ = b
}
func f2() {
var a, b int
a, b = f() // ERROR "assignment mismatch|does not match"
_ = a
_ = b
}
func f() int {
return 1;
}