apidiff: support types.Alias

Use types.Unalias as needed.

For golang/go#70695.

Change-Id: I8595783d9a4c0eef332801135bde490cf745a206
Reviewed-on: https://go-review.googlesource.com/c/exp/+/644877
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/apidiff/apidiff.go b/apidiff/apidiff.go
index c49b488..3a465b1 100644
--- a/apidiff/apidiff.go
+++ b/apidiff/apidiff.go
@@ -309,6 +309,8 @@
 }
 
 func (d *differ) typeChanged(obj objectWithSide, part string, old, new types.Type) {
+	old = types.Unalias(old)
+	new = types.Unalias(new)
 	old = removeNamesFromSignature(old)
 	new = removeNamesFromSignature(new)
 	olds := types.TypeString(old, types.RelativeTo(d.old))
diff --git a/apidiff/correspondence.go b/apidiff/correspondence.go
index 81c0654..8a0ec9a 100644
--- a/apidiff/correspondence.go
+++ b/apidiff/correspondence.go
@@ -27,6 +27,8 @@
 //
 // Compare this to the implementation of go/types.Identical.
 func (d *differ) corr(old, new types.Type, p *ifacePair) bool {
+	old = types.Unalias(old)
+	new = types.Unalias(new)
 	// Structure copied from types.Identical.
 	switch old := old.(type) {
 	case *types.Basic: