compiler: don't generate stubs for ambiguous direct interface methods
authorMikhail Ablakatov <ablakatov.m@gmail.com>
Thu, 12 May 2022 18:45:35 +0000 (21:45 +0300)
committerIan Lance Taylor <iant@golang.org>
Thu, 16 Jun 2022 19:26:15 +0000 (12:26 -0700)
commitb2aaa44d2c9c0e5a31688a6e40a7b132dd03338a
tree2a6377a144c41214ce0cd7af530d380e2ba3fd25
parent98a0d72a610a87e8e383d366e50253ddcc9a51dd
compiler: don't generate stubs for ambiguous direct interface methods

Current implementation checks whether it has to generate a stub method for a
promoted method of an embedded struct field in Type::build_stub_methods(). If
the promoted method is ambiguous it's simply skipped. But struct types that
can fit in an interface value (e.g. structs that consist of a single pointer
field) get a second chance in Type::build_direct_iface_stub_methods().

This patch adds the same check used by Type::build_stub_methods() to
Type::build_direct_iface_stub_methods().

Fixes golang/go#52870

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/405974
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/types.cc