Always use generic method object

This commit is contained in:
Owen Mansel-Chan 2024-10-09 10:56:22 +01:00
Родитель 854d7660eb
Коммит 45710e23c6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 67E427E02E6DA1B8
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -1637,7 +1637,7 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label {
// Note that methods coming from embedded interfaces can be // Note that methods coming from embedded interfaces can be
// accessed through `Method(i)`, so there is no need to // accessed through `Method(i)`, so there is no need to
// deal with them separately. // deal with them separately.
meth := tp.Method(i) meth := tp.Method(i).Origin()
// Note that methods do not have a parent scope, so they are // Note that methods do not have a parent scope, so they are
// not dealt with by `extractScopes` // not dealt with by `extractScopes`
@ -1707,7 +1707,7 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label {
// ensure all methods have labels - note that methods do not have a // ensure all methods have labels - note that methods do not have a
// parent scope, so they are not dealt with by `extractScopes` // parent scope, so they are not dealt with by `extractScopes`
for i := 0; i < origintp.NumMethods(); i++ { for i := 0; i < origintp.NumMethods(); i++ {
meth := origintp.Method(i) meth := origintp.Method(i).Origin()
extractMethod(tw, meth) extractMethod(tw, meth)
} }
@ -1715,7 +1715,7 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label {
// associate all methods of underlying interface with this type // associate all methods of underlying interface with this type
if underlyingInterface, ok := underlying.(*types.Interface); ok { if underlyingInterface, ok := underlying.(*types.Interface); ok {
for i := 0; i < underlyingInterface.NumMethods(); i++ { for i := 0; i < underlyingInterface.NumMethods(); i++ {
methlbl := extractMethod(tw, underlyingInterface.Method(i)) methlbl := extractMethod(tw, underlyingInterface.Method(i).Origin())
dbscheme.MethodHostsTable.Emit(tw, methlbl, lbl) dbscheme.MethodHostsTable.Emit(tw, methlbl, lbl)
} }
} }
@ -1787,7 +1787,7 @@ func getTypeLabel(tw *trap.Writer, tp types.Type) (trap.Label, bool) {
case *types.Interface: case *types.Interface:
var b strings.Builder var b strings.Builder
for i := 0; i < tp.NumMethods(); i++ { for i := 0; i < tp.NumMethods(); i++ {
meth := tp.Method(i) meth := tp.Method(i).Origin()
methLbl := extractType(tw, meth.Type()) methLbl := extractType(tw, meth.Type())
if i > 0 { if i > 0 {
b.WriteString(",") b.WriteString(",")