go/ssa: updated inconsistent docs after Program.Method rename
Fixes golang/go#20225 Change-Id: Ifd069546698981f3c6a3673dd73a1bd770560f8b Reviewed-on: https://go-review.googlesource.com/c/42570 Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
84d77ece31
commit
8542fc29bd
|
@ -23,14 +23,14 @@ import (
|
||||||
//
|
//
|
||||||
func (prog *Program) MethodValue(sel *types.Selection) *Function {
|
func (prog *Program) MethodValue(sel *types.Selection) *Function {
|
||||||
if sel.Kind() != types.MethodVal {
|
if sel.Kind() != types.MethodVal {
|
||||||
panic(fmt.Sprintf("Method(%s) kind != MethodVal", sel))
|
panic(fmt.Sprintf("MethodValue(%s) kind != MethodVal", sel))
|
||||||
}
|
}
|
||||||
T := sel.Recv()
|
T := sel.Recv()
|
||||||
if isInterface(T) {
|
if isInterface(T) {
|
||||||
return nil // abstract method
|
return nil // abstract method
|
||||||
}
|
}
|
||||||
if prog.mode&LogSource != 0 {
|
if prog.mode&LogSource != 0 {
|
||||||
defer logStack("Method %s %v", T, sel)()
|
defer logStack("MethodValue %s %v", T, sel)()
|
||||||
}
|
}
|
||||||
|
|
||||||
prog.methodsMu.Lock()
|
prog.methodsMu.Lock()
|
||||||
|
|
|
@ -654,7 +654,7 @@ type ChangeInterface struct {
|
||||||
// value of a concrete type.
|
// value of a concrete type.
|
||||||
//
|
//
|
||||||
// Use Program.MethodSets.MethodSet(X.Type()) to find the method-set
|
// Use Program.MethodSets.MethodSet(X.Type()) to find the method-set
|
||||||
// of X, and Program.Method(m) to find the implementation of a method.
|
// of X, and Program.MethodValue(m) to find the implementation of a method.
|
||||||
//
|
//
|
||||||
// To construct the zero value of an interface type T, use:
|
// To construct the zero value of an interface type T, use:
|
||||||
// NewConst(constant.MakeNil(), T, pos)
|
// NewConst(constant.MakeNil(), T, pos)
|
||||||
|
|
Loading…
Reference in New Issue