]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: use t.AllMethods when sorting typesByString
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Sun, 30 May 2021 08:35:06 +0000 (15:35 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 8 Jun 2021 12:17:50 +0000 (12:17 +0000)
commit2169deb35247a80794519589e7cd845c6ebf4e5a
tree4daa07d18b27333704f35a6ceac0252324f9c2a8
parentc20bcb64882d1134770683d663ee9f82fea715e6
cmd/compile: use t.AllMethods when sorting typesByString

For interface types, t.Methods contains only unexpanded method set, i.e
exclusive of interface embedding. Thus, we can't use it to detect an
interface contains embedding empty interface, like in:

type EI interface{}

func f() interface{ EI } {
return nil
}

At the time we generate runtime types, we want to check against the full
method set of interface instead.

Fixes #46386

Change-Id: Idff53ad39276be6632eb5932b76e855c15cbdd2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/323649
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/reflectdata/reflect.go
test/fixedbugs/issue46386.go [new file with mode: 0644]