-
Notifications
You must be signed in to change notification settings - Fork 990
compiler: add support for type parameters (aka generics) #2903
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
Conversation
Of course it does not work with Go 1.16 https://app.circleci.com/pipelines/github/tinygo-org/tinygo/7520/workflows/f618ef84-d1b1-42a4-a2e8-a75e9feed751/jobs/37590 |
Same for Go 1.17. Any opinions on this? (Ping @QuLogic) |
Dropping 1.17 could make things hard for developers working on two different projects, one of which requires go 1.17 be installed. If it really isn't hard to support 1.17, I would like to see us do that. We can drop the support after one more major release of go. |
...that was surprisingly easy.
Ok, kept support for Go 1.17 (and probably Go 1.16 as well). |
Tests pass using 1.16 so yes, that appears to be the case. |
A very fine and reasonable patch to cover all the current cases, IMO. Great work @aykevl |
Jeepers, christmas came early @aykevl Edit to add meaningful value to this comment: I'd really like type parameter support. I have quite a few uses for it for personal projects and might have a real use for them at work with a generic FSM I built recently. |
Test failure running the corpus with new generics code:
And the btree code with generics: https://github.com/google/btree/blob/master/btree_generic.go |
Filed #2957 for the overflow with google/btree. |
...that was surprisingly easy.
Doing it now because Go 1.19 requires generics support in the standard library.