tools/refactor
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
..
eg refactor/eg: don't use cgo in Test 2024-02-01 17:54:36 +00:00
importgraph refactor/importgraph: set env from packagestest.Export and check errors from Build 2021-11-30 22:42:17 +00:00
rename x/tools: add explicit Unalias operations 2024-02-28 21:26:44 +00:00
satisfy internal/typeparams: eliminate remainining compatibility shims 2023-12-12 20:07:19 +00:00
README

README

golang.org/x/tools/refactor: libraries for refactoring tools.