Skip to content

Commit

Permalink
apidiff: compare Basic types' kinds for correspondence
Browse files Browse the repository at this point in the history
When determining if two basic types correspond, just compare their kinds
like the definition of types.Identical does.

Change-Id: I6ed0fda3ca686dcfbd8a1df974b07cf48d11239d
Reviewed-on: https://go-review.googlesource.com/c/exp/+/508495
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
  • Loading branch information
jba committed Jul 11, 2023
1 parent c3f3712 commit beca063
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apidiff/correspondence.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ func (d *differ) corr(old, new types.Type, p *ifacePair) bool {
// Structure copied from types.Identical.
switch old := old.(type) {
case *types.Basic:
return types.Identical(old, new)
if new, ok := new.(*types.Basic); ok {
return old.Kind() == new.Kind()
}

case *types.Array:
if new, ok := new.(*types.Array); ok {
Expand Down

0 comments on commit beca063

Please sign in to comment.