]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/types2: only mark variables as used if they are
authorRobert Griesemer <gri@golang.org>
Tue, 18 Apr 2023 23:43:11 +0000 (16:43 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 19 Apr 2023 14:07:00 +0000 (14:07 +0000)
commitd93f02010cbaa83916eecb4fb23dfc4153694dc0
tree32a4fba26064c31e63d4843753daf166ea9b8ae2
parent522eace4ca496626bcb3b65f9dcb6e8db2673fed
cmd/compile/internal/types2: only mark variables as used if they are

Marking variables in erroneous variable declarations as used is
convenient for tests but doesn't necessarily hide follow-on errors
in real code: either the variable is not supposed to be declared in
the first place and then we should get an error if it is not used,
or it is there because it is intended to be used, and the we expect
an error it if is not used.

This brings types2 closer to go/types.

Change-Id: If7ee1298fc770f7ad0cefe7e968533fd50ec2343
Reviewed-on: https://go-review.googlesource.com/c/go/+/486175
Run-TryBot: Robert Griesemer <gri@google.com>
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>
src/cmd/compile/internal/types2/decl.go
src/internal/types/testdata/fixedbugs/issue59371.go
test/fixedbugs/issue30085.go
test/fixedbugs/issue30087.go
test/rename1.go