]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: use the same interface method sorting as types2
authorRobert Griesemer <gri@golang.org>
Wed, 11 Jan 2023 23:03:18 +0000 (15:03 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 17 Jan 2023 19:55:47 +0000 (19:55 +0000)
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 <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
src/go/types/typeset.go

index 35fb155bfa7d3b8b94eb9c9d42b92e2661be0817..64b9734dcdb2017a92aeb95e1f3a0e5a24f92b87 100644 (file)
@@ -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