We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The design draft (Appendix > Generic type aliases) indicates that the following would work:
package pkg type Vector(type T) []T type VectorAlias = Vector var v Vector(int)
However, it doesn't: https://go2goplay.golang.org/p/Gnfiupx2_xT
type checking failed for main prog.go2:4:20: cannot use generic type Vector(type T) without instantiation
go version
go2goplay.golang.org and go version devel +da7932368b Mon Jun 22 19:06:44 2020 +0000 linux/amd64
go2goplay.golang.org
go version devel +da7932368b Mon Jun 22 19:06:44 2020 +0000 linux/amd64
The text was updated successfully, but these errors were encountered:
At the moment only this works.
This is a current limitation of the prototype.
Sorry, something went wrong.
Change https://golang.org/cl/239387 mentions this issue: [dev.go2go] go/types: permit alias to generic type
[dev.go2go] go/types: permit alias to generic type
Turns out this was trivial to fix. Now implemented on dev.go2go. In the playground when it gets updated.
@firelizzard18 Thanks for bringing this to my attention.
2faeebf
Fixes #39768. Change-Id: I68c8fbec5adc50e448dabe90b212ef147a384a06 Reviewed-on: https://go-review.googlesource.com/c/go/+/239387 Reviewed-by: Robert Griesemer <[email protected]>
No branches or pull requests
The design draft (Appendix > Generic type aliases) indicates that the following would work:
However, it doesn't: https://go2goplay.golang.org/p/Gnfiupx2_xT
What version of Go are you using (
go version
)?go2goplay.golang.org
andgo version devel +da7932368b Mon Jun 22 19:06:44 2020 +0000 linux/amd64
The text was updated successfully, but these errors were encountered: