2018-08-24 13:37:25 -06:00
|
|
|
// errorcheck
|
|
|
|
|
|
|
|
// Copyright 2018 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.
|
|
|
|
|
|
|
|
package p
|
|
|
|
|
2020-12-09 13:28:15 -07:00
|
|
|
var x int = three() // ERROR "assignment mismatch: 1 variable but three returns 3 values|3\-valued"
|
2018-08-24 13:37:25 -06:00
|
|
|
|
|
|
|
func f() {
|
2020-12-09 13:28:15 -07:00
|
|
|
var _ int = three() // ERROR "assignment mismatch: 1 variable but three returns 3 values|3\-valued"
|
|
|
|
var a int = three() // ERROR "assignment mismatch: 1 variable but three returns 3 values|3\-valued"
|
|
|
|
a = three() // ERROR "assignment mismatch: 1 variable but three returns 3 values|cannot assign"
|
|
|
|
b := three() // ERROR "assignment mismatch: 1 variable but three returns 3 values|cannot initialize"
|
2018-08-24 13:37:25 -06:00
|
|
|
|
|
|
|
_, _ = a, b
|
|
|
|
}
|
|
|
|
|
|
|
|
func three() (int, int, int)
|