-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
allow type parameters on values other than classes and functions #20015
Comments
then how would |
just in the exact same way as it is for functions:
|
does that happen on every use? or the first, then it is fixed? functions and classes guarantee that each invocation is isolated from the other, but that is not the same as a variable, assuming there is a state involved.. e.g. can i var x: number;
accessor.set({ value: "string" } );
x = accessor.get(); |
just like with the functions where type arguments are required on each call, the arguments for values need to be provided or inferred at each reading (dereferencing) so yes it needs to happen on every use |
in fact at the moment i use functions to do exactly that:
|
also related to #15877 |
Tracking at #17574 |
i can do this:
but i cannot do this:
i wish i could do something like this:
consider allowing type parameters on values other than functions and classes
The text was updated successfully, but these errors were encountered: