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: compiler error after translation #39692
Comments
Looks like the translator somehow substituted the underlying type for the defined type. |
This kind of thing is a bug in the translation tool. Basically, the code passed the type checker, but the generated Go-without-generics code is somehow using the wrong type. Although I've been working on similar bug reports, and this code now fails in a completely different way. But it's still a bug in the translation tool. |
This should be fixed now in the dev.go2go branch. Thanks for the test case. |
Change https://golang.org/cl/238797 mentions this issue: |
Previously we instantiated the underlying type, so we didn't need this. We stopped doing that to get the same type in the generated code, but now we need to get the right type arguments, rather than just leaving the type parameters there. Fixes #39692 Change-Id: I56ba8ff017c37219e7cb9bb6e07a4beb8c50e9dc Reviewed-on: https://go-review.googlesource.com/c/go/+/238797 Reviewed-by: Ian Lance Taylor <iant@golang.org>
What version of Go are you using (
go version
)?go2go playground
What did you do?
https://go2goplay.golang.org/p/LDEr36y6IUr
Source
What did you expect to see?
No compiler error and no output
What did you see instead?
A large error message
This seemed more important because it happens after translation, which possibly indicates a soundness hole in the type checker? Though, I do believe the program is well typed, so maybe just a bug in the translation.
The text was updated successfully, but these errors were encountered: