mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
Follow by the [Spec](https://go.dev/ref/spec#Assignment_statements): The number of operands on the left hand side must match the number of values. For instance, if f is a function returning two values `x, y = f()` assigns the first value to x and the second to y. In the second form, the number of operands on the left must equal the number of expressions on the right, each of which must be single-valued, and the nth expression on the right is assigned to the nth operand on the left. Fixes #1606
10 lines
141 B
Go
10 lines
141 B
Go
package main
|
|
|
|
func main() {
|
|
a, b, c := 1, 2
|
|
_, _, _ = a, b, c
|
|
}
|
|
|
|
// Error:
|
|
// _test/assign19.go:4:2: cannot assign 2 values to 3 variables
|