1
0
mirror of https://github.com/golang/go synced 2024-09-30 01:24:33 -06:00

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 <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>
This commit is contained in:
Robert Griesemer 2023-01-11 15:03:18 -08:00 committed by Gopher Robot
parent 248950f192
commit 5ce9d9fee8

View File

@ -381,7 +381,7 @@ func assertSortedMethods(list []*Func) {
type byUniqueMethodName []*Func type byUniqueMethodName []*Func
func (a byUniqueMethodName) Len() int { return len(a) } 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] } 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 // invalidTypeSet is a singleton type set to signal an invalid type set