You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Take a look at #23696 where this was tried. There was some concern that this made formerly private interfaces (the names of generic types) public. Because of this concern the PR was superseded by #26349
We're still investigating the whole named type arguments story as part of partial inference and handling of generics defaults (see linked PRs as suggested).
I think we can confidently say that the "simple" case of passing type arguments by name has been mostly ruled out due to compat concerns - we have been very careful so far to make type parameter names not observable outside the declaration itself and would prefer to keep it that way unless there's absolutely no other way to accomplish the task.
Search Terms
Suggestion
Allow generic consumer to pass generic argument by name, for instance:
This would allow us to write and use a generic with thousands of parameter without decreasing readability.
NOTES
Use Cases
Above
Examples
Above
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: