]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: more systematic use of Checker.use und useLHS
authorRobert Griesemer <gri@golang.org>
Wed, 22 Mar 2023 18:59:39 +0000 (11:59 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 28 Mar 2023 14:28:33 +0000 (14:28 +0000)
commitabf9b112fd12e05da2d064554d51d140c2871741
tree712f4b3cf615b72855824259b3d58a7b3c476552
parent3ed8a1e629e95dc6337a73d5db9936dabd43f4f4
go/types, types2: more systematic use of Checker.use und useLHS

This CL re-introduces useLHS because we don't want to suppress
correct "declared but not used" errors for variables that only
appear on the LHS of an assignment (using Checker.use would mark
them as used).

This CL also adjusts a couple of places where types2 differed
from go/types (and suppressed valid "declared and not used"
errors). Now those errors are surfaced. Adjusted a handful of
tests accordingly.

Change-Id: Ia555139a05049887aeeec9e5221b1f41432c1a57
Reviewed-on: https://go-review.googlesource.com/c/go/+/478635
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/assignments.go
src/cmd/compile/internal/types2/call.go
src/go/types/assignments.go
src/go/types/call.go
test/fixedbugs/bug062.go
test/fixedbugs/bug131.go
test/fixedbugs/bug289.go
test/fixedbugs/issue48471.go
test/fixedbugs/issue9083.go
test/interface/pointer.go