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/go2go: spurious compile error when accessing field promoted from parameterized type embedded in struct #44689
Comments
This one is just a bug in the experimental go2go tool (the distinction is that it doesn't say "type checking failed for ..."). The go2go tool has many bugs involving embedded fields. I'm willing to review patches to fix it, but I don't plan to do further work on it myself. |
I'm confused. Shouldn't this be a legal program?
Russ invited me to try out the generics implementation on some realistic programs, and these two issues were both obstacles for the programs I wanted to write. Should I be using something other than go2go? |
What I mean is: if you get an error message "type checking failed for..." for a valid program, then there is a bug in the type checker, and that bug needs to be fixed. If you get an error for a valid program that does not say "type checking failed for...", then you have encountered a bug in the experimental go2go tool. The tool was intended for experimenting with generics while the proposal was being shaped, and we're beyond that point now. The tool has many limitations and I have no plans to continue enhancing it. I think it's more important to work on the actual implementation of generics.
No, there is nothing else. But avoid embedded fields involving generic types. Support for them is limited. The only way that a tool like go2go can support them is to completely rewrite all field references. It could do that in principle, but it's a fair amount of work, and it was never done. Sorry. |
I think this is a dup of #43621? |
We aren't going to do anything in any case, so closing. |
This program (https://go2goplay.golang.org/p/qrOFrB-Udhh):
causes go2go to emit the spurious-looking error shown in the comment.
(The error message is also confusing because the q.P field access doesn't appear on the source line.)
(Similar but different: #44688)
dev.go2go version 356c171
The text was updated successfully, but these errors were encountered: