New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gccgo/gollvm: incorrect finalization of ambiguous promoted methods #52870
Labels
Milestone
Comments
I'll submit a fix for this issue soon. |
Change https://go.dev/cl/405974 mentions this issue: |
heschi
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
May 13, 2022
Change https://go.dev/cl/412535 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
Jun 16, 2022
For #52870 Change-Id: Ic0791af4283c9e426f7cbfab0514517ff84cfa80 Reviewed-on: https://go-review.googlesource.com/c/go/+/412535 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
xionghul
pushed a commit
to xionghul/gcc
that referenced
this issue
Jun 16, 2022
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
realqhc
pushed a commit
to realqhc/gofrontend
that referenced
this issue
Aug 4, 2022
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 Change-Id: If679e7bda8793b3cdc411419806fa36d5536faa4 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/405974 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
If a type that is stored directly in an interface data word includes ambiguous promoted methods, finalization of its methods results in
error: incompatible type for receiver (cannot use type <A> as type <B>)
.What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The issue may be reproduced with the following sample:
foo/foo.go
bar/bar.go
baz/baz1.go
baz/baz2.go
What did you expect to see?
No error, successful build.
What did you see instead?
An attempt to build this sample results in:
The text was updated successfully, but these errors were encountered: