Skip to content

Commit 3edf0e9

Browse files
committed
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 7588d65 commit 3edf0e9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

apidiff/apidiff.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ func (d *differ) checkCorrespondence(obj objectWithSide, part string, old, new t
309309
}
310310

311311
func (d *differ) typeChanged(obj objectWithSide, part string, old, new types.Type) {
312+
old = types.Unalias(old)
313+
new = types.Unalias(new)
312314
old = removeNamesFromSignature(old)
313315
new = removeNamesFromSignature(new)
314316
olds := types.TypeString(old, types.RelativeTo(d.old))

apidiff/correspondence.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ func (d *differ) correspond(old, new types.Type) bool {
2727
//
2828
// Compare this to the implementation of go/types.Identical.
2929
func (d *differ) corr(old, new types.Type, p *ifacePair) bool {
30+
old = types.Unalias(old)
31+
new = types.Unalias(new)
3032
// Structure copied from types.Identical.
3133
switch old := old.(type) {
3234
case *types.Basic:

0 commit comments

Comments
 (0)