mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +00:00
compiler: don't try to get pointer methods
I don't know why this was ever needed, but it seems to be incorrect and unnecessary.
This commit is contained in:
+3
-12
@@ -721,22 +721,13 @@ func (c *Compiler) getDIType(typ types.Type) (llvm.Metadata, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Get all methods of a type: both value receivers and pointer receivers.
|
||||
// Get all methods of a type.
|
||||
func getAllMethods(prog *ssa.Program, typ types.Type) []*types.Selection {
|
||||
var methods []*types.Selection
|
||||
|
||||
// value receivers
|
||||
ms := prog.MethodSets.MethodSet(typ)
|
||||
methods := make([]*types.Selection, ms.Len())
|
||||
for i := 0; i < ms.Len(); i++ {
|
||||
methods = append(methods, ms.At(i))
|
||||
methods[i] = ms.At(i)
|
||||
}
|
||||
|
||||
// pointer receivers
|
||||
ms = prog.MethodSets.MethodSet(types.NewPointer(typ))
|
||||
for i := 0; i < ms.Len(); i++ {
|
||||
methods = append(methods, ms.At(i))
|
||||
}
|
||||
|
||||
return methods
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user