-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/compile: internal compiler error when compiling code with unbound method of generic type [1.19 backport] #54243
Comments
From #53852 (comment) , we avoided backporting generics fixes because they tended to be destabilizing. I suspect we will want to do something similar for 1.20, especially once we switch over to unified IR, at which point any fixes for 1.19 will be different from fixes for tip. But for now I think the CL for this issue is simple enough to warrant a backport. This is an ICE caused by embedding a generic type and calling a method on that type. |
We suspect this is related, here's a way to reproduce: |
Change https://go.dev/cl/423114 mentions this issue: |
Closed by merging 16c2b36 to release-branch.go1.19. |
…r expr with embedded generic type For selector expression "x.M" where "M" is a promoted method, irgen is using the type of receiver "x" for determining the typeparams for instantiation. However, because M is a promoted method, so its associated receiver is not "x", but "x.T" where "T" is the embedded field of "x". That casues a mismatch when converting non-shape types arguments. Fixing it by using the actual receiver which has the method, instead of using the base receiver. Fixes #54243 Change-Id: I1836fc422d734df14e9e6664d4bd014503960bfc Reviewed-on: https://go-review.googlesource.com/c/go/+/419294 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/423114 Reviewed-by: Carlos Amedee <carlos@golang.org>
…r expr with embedded generic type For selector expression "x.M" where "M" is a promoted method, irgen is using the type of receiver "x" for determining the typeparams for instantiation. However, because M is a promoted method, so its associated receiver is not "x", but "x.T" where "T" is the embedded field of "x". That casues a mismatch when converting non-shape types arguments. Fixing it by using the actual receiver which has the method, instead of using the base receiver. Fixes golang#54243 Change-Id: I1836fc422d734df14e9e6664d4bd014503960bfc Reviewed-on: https://go-review.googlesource.com/c/go/+/419294 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/423114 Reviewed-by: Carlos Amedee <carlos@golang.org>
@randall77 requested issue #53982 to be considered for backport to the next 1.19 minor release.
The text was updated successfully, but these errors were encountered: