mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
950a56899a
commit
33eaf75a03
2 changed files with 60 additions and 66 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue