go/types: don't override x.mode before using it
go/types: don't override x.mode before using it

Changing the mode of x before using the old value is clearly wrong.
And x is not needed anymore afterward so besides being misplaced,
the assignment is not needed in the first place.

Tested manually as it's a bit complicated to set up a test.

Needs to be back-ported to 1.17.

Fixes #47777.

Change-Id: I06f1fa9443eb98009b4276f566d557fd52f1d6d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/343809
Trust: Robert Griesemer <a6752097faebf1f02d80107d77a9be009089afe3@golang.org>
Reviewed-by: Matthew Dempsky <e56ac2c500064424afac424d4b5e53bd0570a731@google.com>

nawawi/go,golang/go,CAFxX/go,nawawi/go,golang/go,CAFxX/go,CAFxX/go,golang/go,nawawi/go,nawawi/go,cloudflare/go,CAFxX/go,golang/go,nawawi/go,CAFxX/go,CAFxX/go,nawawi/go,golang/go,CAFxX/go,cloudflare/go,cloudflare/go,cloudflare/go,golang/go,cloudflare/go,golang/go,nawawi/go,cloudflare/go,cloudflare/go,golang/go,CAFxX/go,nawawi/go,cloudflare/go