LookupMethod returns the implementation of the method of type T identified by (pkg, name). It returns nil if the method exists but is abstract, and panics if T has no such method.
(T Type, pkg *Package, name string)
| 43 | // is abstract, and panics if T has no such method. |
| 44 | // |
| 45 | func (prog *Program) LookupMethod(T Type, pkg *Package, name string) *Function { |
| 46 | sel := prog.MethodSets.MethodSet(T).Lookup(pkg, name) |
| 47 | if sel == nil { |
| 48 | panic(fmt.Sprintf("%s has no method %s", T, Id(pkg, name))) |
| 49 | } |
| 50 | return prog.MethodValue(sel) |
| 51 | } |
| 52 | |
| 53 | // ssaMethodSet contains the (concrete) methods of a non-interface type. |
| 54 | type ssaMethodSet struct { |
no test coverage detected