tools/cmd
Alan Donovan 38b0e9bfdb x/tools: add explicit Unalias operations
This change is the result of an audit of all type assertions
and type switches whose operand is a types.Type. (These were
enumerated with an analyzer tool.)

If the operand is already the result of a call to Underlying
or Unalias, there is nothing to do, but in other cases,
explicit Unalias operations were added in order to preserve
the existing behavior when go/types starts creating explicit
Alias types.

This change does not address any desired behavior changes
required for the ideal handling of aliases; they will wait
for a followup. In a number of places I have added comments
matching "TODO.*alias".

It may be prudent to split this change by top-level directory,
both for ease of review, and of later bisection if needed.

During the audit, there appeared to be a recurring need
for the following operators:
- (*types.Func).Signature (golang/go#65772);
- Deref(Type): it's easy to forget to strip off the
  Alias constructor;
- ReceiverName (CL 565075), for destructuring receiver
  types such as T and *T, in which up to two Aliases
  might be present.

Updates golang/go#65294

Change-Id: I5180b9bae1c9191807026b8e0dc6f15ed4953b9a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/565035
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2024-02-28 21:26:44 +00:00
..
auth
benchcmp
bisect
bundle
callgraph cmd/callgraph: unskip TestCallgraph on windows/arm64 2024-01-29 18:13:43 +00:00
compilebench
deadcode x/tools: update telemetry import (new Start API) 2024-02-28 20:27:29 +00:00
digraph
eg
file2fuzz
fiximports
go-contrib-init
godex x/tools: add explicit Unalias operations 2024-02-28 21:26:44 +00:00
godoc
goimports
gomvpkg
gonew
gorename
gotype
goyacc
guru x/tools: add explicit Unalias operations 2024-02-28 21:26:44 +00:00
html2article
present
present2md
signature-fuzzer
splitdwarf
ssadump
stress
stringer cmd/stringer, go/loader: use testenv.NeedsTool(t, "cgo") 2024-02-01 17:54:33 +00:00
toolstash