mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: unified IR support for implicit interfaces
Change-Id: Ibdaa0750f7bc47b513c047fdf4b7145ebba9e870 Reviewed-on: https://go-review.googlesource.com/c/go/+/386001 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Trust: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
7c151f3280
commit
21998413ad
3 changed files with 17 additions and 1 deletions
|
|
@ -449,6 +449,8 @@ func (r *reader) interfaceType() *types.Type {
|
|||
tpkg := types.LocalPkg // TODO(mdempsky): Remove after iexport is gone.
|
||||
|
||||
nmethods, nembeddeds := r.Len(), r.Len()
|
||||
implicit := nmethods == 0 && nembeddeds == 1 && r.Bool()
|
||||
assert(!implicit) // implicit interfaces only appear in constraints
|
||||
|
||||
fields := make([]*types.Field, nmethods+nembeddeds)
|
||||
methods, embeddeds := fields[:nmethods], fields[nmethods:]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue