-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Proposal: Static Generics #3460
Comments
This functionality will hopefully be provided by the shapes proposal. #164 |
An enhancement of generic type system should have been planned for C# 10 (See Language Version Planning). We don't need to open new issues for specific scenarios, as the enhancement are supposed to be wider. The language team is currently completing C# 9 that features records. Once C# 9 has been completed, they should be able to focus on the enhancement. |
There is some type system improvement stuff triaged into 10, but I wouldn't expect anything really big until 11. Some of the stuff in 10 is there to make sure we talk about it during that time frame. |
Generic method has already made code analysis awkward sometimes, for example, locking. I'm afraid the current proposal would introduce more hard-to-lint cases. IMHO, restrictions should be added at least. What about:
|
Proposal: Static Generics
For people who are not familiar with Static Generics, please see https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/generics/statically-resolved-type-parameters
Proposed syntax
Use
inline
to mark the functions/classes are resolved from caller,'T
for static generic type parameters.The text was updated successfully, but these errors were encountered: