-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: gotip internal compiler error: shape types have no methods .shape.string_0 #49309
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
Comments
Sounds like the problem dues to inlining. We implicitly generate |
Yes, this one is tricky. Easier to discuss if we use this example with no anonymous func and better names:
I guess this points out a general problem that we may reveal new CONVIFACE calls related to typeparams in a function instantiation after the fact by doing inlining. However, this can only happen if we actually pass in an inlineable function as an argument ("myfunc" here) that matches a relevant typeparam, and then can inline that function call, because we were actually able to inline the function instantiation as well.... (i.e. we were able to inline "genfunc[%2eshape.string_0]" into main, which means we are then able to inline "myfunc" as well. Because r is "stuck" as a shape type, we need a dictionary when converting r to an empty interface in order to call test2. We don't want to disable inlining generally in function instantiations, but maybe we can disable inlining for functions that have shape args? Still thinking about it. |
We do have the |
Sorry, I was a little unclear. As it stands, we want to set the dictionary format for an instantiation (what derived types are relevant, what itabs are needed) right after the stenciling . But in this case, we won't necessarily have the right dictionary entry after the inlining has happened and reveals a new interface conversion (and we would need to run the dictPass again to use that dictionary entry). |
Change https://golang.org/cl/361260 mentions this issue: |
Change https://go.dev/cl/424775 mentions this issue: |
The non-unified frontend had repeated issues with inlining and generics (#49309, #51909, #52907), which led us to substantially restrict inlining when shape types were present. However, these issues are evidently not present in unified IR's inliner, and the safety restrictions added for the non-unified frontend can simply be disabled in unified mode. Fixes #54497. Change-Id: I8e6ac9f3393c588bfaf14c6452891b9640a9d1bd Reviewed-on: https://go-review.googlesource.com/c/go/+/424775 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
What version of Go are you using (
go version
)?What did you do?
What did you expect to see?
Successful compilation
What did you see instead?
The text was updated successfully, but these errors were encountered: