]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: refactor assignVars
authorRobert Griesemer <gri@golang.org>
Tue, 21 Mar 2023 16:58:03 +0000 (09:58 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 28 Mar 2023 17:34:13 +0000 (17:34 +0000)
commitc02e1bfbdb7ff9d4c2ecf8a9859ccecd8eadfc59
tree4c029fb161887477cc562467d659dddb168d2dcb
parent4237dea5e36fa4c0900cb6b0850b1871f4e4c404
go/types, types2: refactor assignVars

Rather than using exprList and handle all cases together, split
apart the cases of n:n assignments and the cases of n:1 assignments.
For the former, the lhs types may (in a future CL) be used to infer
types on the rhs. This is a preparatory step.

Because the two cases are handled separately, the code is longer
(but also more explicit).

Some test cases were adjusted to avoifd (legitimate, but previously
supressed) "declared but not used" errors.

Change-Id: Ia43265f84e423b0ad5594612ba5a0ddce31a4a37
Reviewed-on: https://go-review.googlesource.com/c/go/+/478256
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/assignments.go
src/cmd/compile/internal/types2/expr.go
src/go/types/assignments.go
src/go/types/expr.go