cmd/compile: cleanup method expression type checking

Passes toolstash-check.

Change-Id: I804e73447b6fdbb75af6235c193c4ee7cbcf8d3a
Reviewed-on: https://go-review.googlesource.com/105045
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Matthew Dempsky 2018-04-06 00:54:20 -07:00
parent 950a56899a
commit 33eaf75a03
2 changed files with 60 additions and 66 deletions

View file

@ -406,12 +406,7 @@ func methods(t *types.Type) []*Sig {
// if pointer receiver but non-pointer t and
// this is not an embedded pointer inside a struct,
// method does not apply.
this := f.Type.Recv().Type
if this.IsPtr() && this.Elem() == t {
continue
}
if this.IsPtr() && !t.IsPtr() && f.Embedded != 2 && !isifacemethod(f.Type) {
if !isMethodApplicable(t, f) {
continue
}
@ -431,6 +426,8 @@ func methods(t *types.Type) []*Sig {
sig.type_ = methodfunc(f.Type, t)
sig.mtype = methodfunc(f.Type, nil)
this := f.Type.Recv().Type
if !sig.isym.Siggen() {
sig.isym.SetSiggen(true)
if !eqtype(this, it) {