diff options
author | Dan Scales <danscales@google.com> | 2021-03-04 12:09:04 -0800 |
---|---|---|
committer | Dan Scales <danscales@google.com> | 2021-03-04 23:37:01 +0000 |
commit | 96a96a9058004af531db56dee26d82af08321cdb (patch) | |
tree | 83982a0a02c0e1a3799baa7c670f46ca5fa98fc0 /src/cmd/compile/internal/types2/selection.go | |
parent | d891ebdce1ac2c72e1d923c24f5a65ec14ba7cf8 (diff) | |
download | go-96a96a9058004af531db56dee26d82af08321cdb.tar.gz go-96a96a9058004af531db56dee26d82af08321cdb.zip |
cmd/compile: remove types2.(*Selection).TArgs(), now that instance bug seems fixed
Previously, we would sometimes see an internal (*instance) type for a
receiver of a types2 method, which was a bug. To deal with that, we put
in an extra (*Selection).TArgs() method. However, that (*instance) type
is no longer showing up for receivers, so we can remove the types2
method we added and do the work with existing types2 API methods.
Change-Id: I03e68f5bbaaf82fe706b6efecbb02e951bbd3cd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/298869
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/selection.go')
-rw-r--r-- | src/cmd/compile/internal/types2/selection.go | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/cmd/compile/internal/types2/selection.go b/src/cmd/compile/internal/types2/selection.go index 02c0fc6902..8128aeee2e 100644 --- a/src/cmd/compile/internal/types2/selection.go +++ b/src/cmd/compile/internal/types2/selection.go @@ -51,22 +51,6 @@ func (s *Selection) Kind() SelectionKind { return s.kind } // Recv returns the type of x in x.f. func (s *Selection) Recv() Type { return s.recv } -// Work-around for a compiler issue where an (*instance) escapes. -// TODO(gri): Is this still needed? -func (s *Selection) TArgs() []Type { - r := s.recv - if p := asPointer(r); p != nil { - r = p.Elem() - } - if n := asNamed(r); n != nil { - return n.TArgs() - } - // The base type (after skipping any pointer) must be a Named type. The - // bug is that sometimes it can be an instance type (which is supposed to - // be an internal type only). - return r.(*instance).targs -} - // Obj returns the object denoted by x.f; a *Var for // a field selection, and a *Func in all other cases. func (s *Selection) Obj() Object { return s.obj } |