-
Notifications
You must be signed in to change notification settings - Fork 86
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
[Feature] Add an array generic type #391
Comments
what about adding explicit |
Yeah.. I've been thinking about this... if this is a good idea to introduce such type. TypeScript has done it because JS enforced it. Aaaand... in any real project you're advised not to use it. So this was a proposition that would not lead people to bad patterns. If you want to use |
How about we add generics instead.
|
[]
I'd start with the generic array, as it is simpler to implement and to use. Also we don't have to limit it to parameters, it might be useful as a return type, too. Then, later on, we can extend this syntax to also allow named generics such as |
I like this |
I love that idea of |
Is your feature request related to a problem? Please describe.
The problem is that sometimes a person might want to match any Array type when declaring a function parameter.
Describe the solution you'd like
[]
syntax in Types[]
type only in function parameter types.Describe alternatives you've considered
I've considered function overloading but it seems to be an overkill.
Additional context
This way we can more precisely specify the context and use of functions.
The text was updated successfully, but these errors were encountered: