Skip to content
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

Generics support on various code points #16

Merged
merged 8 commits into from
Aug 22, 2022
Merged

Generics support on various code points #16

merged 8 commits into from
Aug 22, 2022

Conversation

moznion
Copy link
Owner

@moznion moznion commented Aug 22, 2022

Support the generics syntax in the following syntaxes/notations:

  • generic types on function invocation like foo[int64](123)
  • generic parameter names on function receiver like func (s MyStruct[T])
  • generic parameter names on function return values like func foo[T struct]() MyStruct[T]
  • generic type parameters on interface declaration like type MyInterface[T any] interface {}

This patch also introduces TypeParameterNames which is an alias of []string to represent the generic parameter names, e.g. T.
And this patch makes it supports the generics union types.

@moznion moznion added the enhancement New feature or request label Aug 22, 2022
@moznion moznion self-assigned this Aug 22, 2022
@moznion moznion changed the title Generics support on various points Generics support on various code points Aug 22, 2022
@moznion moznion merged commit 2511448 into master Aug 22, 2022
@moznion moznion deleted the generics_support branch August 22, 2022 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant