From 5ce9d9fee85bbdc952b7b20e94811fa24d36f1f6 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 11 Jan 2023 15:03:18 -0800 Subject: [PATCH] go/types: use the same interface method sorting as types2 See also CL 321231 which introduces object.less to match expected compiler behavior. Change-Id: I56fbf332a04596dc96393b71d40acf4df5d950fd Reviewed-on: https://go-review.googlesource.com/c/go/+/461677 Run-TryBot: Robert Griesemer Reviewed-by: Robert Findley Auto-Submit: Robert Griesemer TryBot-Result: Gopher Robot Reviewed-by: Robert Griesemer --- src/go/types/typeset.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/types/typeset.go b/src/go/types/typeset.go index 35fb155bfa..64b9734dcd 100644 --- a/src/go/types/typeset.go +++ b/src/go/types/typeset.go @@ -381,7 +381,7 @@ func assertSortedMethods(list []*Func) { type byUniqueMethodName []*Func func (a byUniqueMethodName) Len() int { return len(a) } -func (a byUniqueMethodName) Less(i, j int) bool { return a[i].Id() < a[j].Id() } +func (a byUniqueMethodName) Less(i, j int) bool { return a[i].less(&a[j].object) } func (a byUniqueMethodName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } // invalidTypeSet is a singleton type set to signal an invalid type set