Files
Kevin ChenandGitHub 64f2f987f3 interp: fix mismatch assign statement panic
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
2024-07-19 13:46:03 +02:00

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